<?phpdeclare(strict_types=1);namespace App\Domain\Entity;use ApiPlatform\Metadata\ApiProperty;class Invoice{ #[ApiProperty(identifier: true)] public ?int $id = null; public function __construct( public string $name, public int $number, ) { } public function getLabel(): string { $number = str_pad("$this->number", 6, '0', STR_PAD_LEFT); return "$this->name-$number"; }}