'\d+'], normalizationContext: ['groups' => ['shipment-type:read']], ), new GetCollection( normalizationContext: ['groups' => ['shipment-type:read']], ), ], security: "is_granted('ROLE_USER')", )] class ShipmentType { #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column] #[Groups(['shipment-type:read', 'shipment:read'])] private ?int $id = null; #[ORM\Column(length: 255)] #[Groups(['shipment-type:read', 'shipment:read'])] private ?string $label = null; #[ORM\Column(length: 255)] #[Groups(['shipment-type:read', 'shipment:read'])] private ?string $code = null; #[ORM\OneToMany(mappedBy: 'shipmentType', targetEntity: Shipment::class)] private Collection $shipments; public function __construct() { $this->shipments = new ArrayCollection(); } 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): self { $this->code = $code; return $this; } }