['bovine_movement:write']], normalizationContext: ['groups' => ['bovine:read']], processor: BovineMovementProcessor::class, ), ], security: "is_granted('ROLE_BUREAU')", )] class BovineMovement { #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column] #[Groups(['bovine:read'])] private ?int $id = null; #[ORM\ManyToOne(inversedBy: 'movements')] #[ORM\JoinColumn(nullable: false, onDelete: 'CASCADE')] #[Groups(['bovine_movement:write'])] private Bovine $bovine; #[ORM\ManyToOne] #[Groups(['bovine:read', 'bovine_movement:write'])] #[ApiProperty(readableLink: true)] private ?BuildingCase $buildingCase = null; #[ORM\Column(type: 'datetime_immutable')] #[Groups(['bovine:read', 'bovine_movement:write'])] private DateTimeImmutable $enteredAt; #[ORM\Column(type: 'datetime_immutable', nullable: true)] #[Groups(['bovine:read'])] private ?DateTimeImmutable $leftAt = null; public function getId(): ?int { return $this->id; } public function getBovine(): Bovine { return $this->bovine; } public function setBovine(Bovine $bovine): static { $this->bovine = $bovine; return $this; } public function getBuildingCase(): ?BuildingCase { return $this->buildingCase; } public function setBuildingCase(?BuildingCase $buildingCase): static { $this->buildingCase = $buildingCase; return $this; } public function getEnteredAt(): DateTimeImmutable { return $this->enteredAt; } public function hasEnteredAt(): bool { return isset($this->enteredAt); } public function setEnteredAt(DateTimeImmutable $enteredAt): static { $this->enteredAt = $enteredAt; return $this; } public function getLeftAt(): ?DateTimeImmutable { return $this->leftAt; } public function setLeftAt(?DateTimeImmutable $leftAt): static { $this->leftAt = $leftAt; return $this; } }