<?phpnamespace App\V4\Model\Naf;use App\Model\IriNormalizableInterface;use App\Model\NormalizeAsIRITrait;use App\Model\Traits\ImportableObjectTrait;use Symfony\Component\Serializer\Annotation\Groups;class Naf implements IriNormalizableInterface{ use ImportableObjectTrait; use NormalizeAsIRITrait; /** * @var string * * @Groups({ * "prospect:list", "prospect:read", "prospect:write", "prospect:update" * }) */ private $id; /** * @var string|null * * @Groups({ * "prospect:list", "prospect:read", "prospect:write", "prospect:update" * }) */ private $code; /** * @var string|null * @Groups({ * "prospect:list", "prospect:read", "prospect:write", "prospect:update" * }) */ private $label; /** * @var bool */ private $fromForm = false; public function getFullLabel(): string { return "{$this->getCode()} - {$this->getLabel()}"; } /** * @return string */ public function getId(): string { return $this->id; } /** * @param string $id * * @return Naf */ public function setId(string $id): Naf { $this->id = $id; return $this; } /** * @return string|null */ public function getCode(): ?string { return $this->code; } /** * @param string|null $code * * @return Naf */ public function setCode(?string $code): Naf { $this->code = $code; return $this; } /** * @return string|null */ public function getLabel(): ?string { return $this->label; } /** * @param string|null $label * * @return Naf */ public function setLabel(?string $label): Naf { $this->label = $label; return $this; } /** * For setting up the default value in ChoiceType in the edit form. * * @return string */ public function __toString(): string { return $this->getId(); } /** * @return bool */ public function isFromForm(): bool { return $this->fromForm; } /** * @param bool $fromForm * * @return Naf */ public function setFromForm(bool $fromForm): Naf { $this->fromForm = $fromForm; return $this; }}