'\d+'], normalizationContext: ['groups' => ['building:read']], ), new GetCollection( normalizationContext: ['groups' => ['building:read']], ), ], security: "is_granted('ROLE_USER')", )] class Statut { #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column] #[Groups(['building:read'])] private ?int $id = null; #[ORM\Column(length: 255)] #[Groups(['building:read'])] private ?string $label = null; #[ORM\Column(length: 255)] #[Groups(['building:read'])] private ?string $code = null; #[ORM\Column(length: 255)] #[Groups(['building:read'])] #[SerializedName('couleur')] private ?string $color = null; /** * @var Collection */ #[ORM\OneToMany(targetEntity: BuildingCase::class, mappedBy: 'statut')] private Collection $id_case; public function __construct() { $this->id_case = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function setId(int $id): static { $this->id = $id; return $this; } public function getLabel(): ?string { return $this->label; } public function setLabel(string $label): static { $this->label = $label; return $this; } public function getCode(): ?string { return $this->code; } public function setCode(string $code): static { $this->code = $code; return $this; } public function getColor(): ?string { return $this->color; } public function setColor(string $color): static { $this->color = $color; return $this; } /** * @return Collection */ public function getIdCase(): Collection { return $this->id_case; } public function addIdCase(BuildingCase $idCase): static { if (!$this->id_case->contains($idCase)) { $this->id_case->add($idCase); $idCase->setStatut($this); } return $this; } public function removeIdCase(BuildingCase $idCase): static { if ($this->id_case->removeElement($idCase)) { // set the owning side to null (unless already changed) if ($idCase->getStatut() === $this) { $idCase->setStatut(null); } } return $this; } }