'\d+'], normalizationContext: ['groups' => ['bovine-type:read']], ), new GetCollection( normalizationContext: ['groups' => ['bovine-type:read']], ), new Post( normalizationContext: ['groups' => ['bovine-type:read']], denormalizationContext: ['groups' => ['bovine-type:write']], security: "is_granted('ROLE_ADMIN')", ), new Patch( requirements: ['id' => '\d+'], normalizationContext: ['groups' => ['bovine-type:read']], denormalizationContext: ['groups' => ['bovine-type:write']], security: "is_granted('ROLE_ADMIN')", ), ], security: "is_granted('ROLE_USER')", )] class BovineType { #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column] #[Groups(['bovine-type:read', 'reception:read', 'reception-bovine:read'])] private ?int $id = null; #[ORM\Column(length: 120)] #[Groups(['bovine-type:read', 'bovine-type:write', 'reception:read', 'reception-bovine:read'])] private ?string $label = null; #[ORM\Column(length: 50)] #[Groups(['bovine-type:read', 'bovine-type:write', 'reception:read', 'reception-bovine:read'])] private ?string $code = null; public function getId(): ?int { return $this->id; } 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; } }