['formation:read', 'employee:read'], 'datetime_format' => 'Y-m-d', ], denormalizationContext: [ 'groups' => ['formation:write'], 'datetime_format' => 'Y-m-d', ], order: ['startDate' => 'DESC'], paginationEnabled: false, )] #[ApiFilter(DateFilter::class, properties: ['startDate', 'endDate'])] #[ApiFilter(SearchFilter::class, properties: ['employee' => 'exact'])] #[ORM\Entity(repositoryClass: FormationRepository::class)] #[ORM\Table(name: 'formations')] class Formation { #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column(type: 'integer')] #[Groups(['formation:read'])] private ?int $id = null; #[ORM\ManyToOne(targetEntity: Employee::class)] #[ORM\JoinColumn(nullable: false)] #[Groups(['formation:read', 'formation:write'])] private ?Employee $employee = null; #[ORM\Column(type: 'date_immutable')] #[Groups(['formation:read', 'formation:write'])] private ?DateTimeImmutable $startDate = null; #[ORM\Column(type: 'date_immutable')] #[Groups(['formation:read', 'formation:write'])] private ?DateTimeImmutable $endDate = null; #[ORM\Column(type: 'text', nullable: true)] #[Groups(['formation:read', 'formation:write'])] private ?string $comment = null; #[ORM\Column(type: 'string', length: 255, nullable: true)] #[Groups(['formation:read'])] private ?string $justificatifPath = null; #[ORM\Column(type: 'string', length: 255, nullable: true)] #[Groups(['formation:read'])] private ?string $justificatifName = null; #[ORM\Column(type: 'datetime_immutable')] #[Groups(['formation:read'])] private DateTimeImmutable $createdAt; public function __construct() { $this->createdAt = new DateTimeImmutable(); } public function getId(): ?int { return $this->id; } public function getEmployee(): ?Employee { return $this->employee; } public function setEmployee(?Employee $employee): self { $this->employee = $employee; return $this; } public function getStartDate(): ?DateTimeImmutable { return $this->startDate; } public function setStartDate(?DateTimeImmutable $startDate): self { $this->startDate = $startDate; return $this; } public function getEndDate(): ?DateTimeImmutable { return $this->endDate; } public function setEndDate(?DateTimeImmutable $endDate): self { $this->endDate = $endDate; return $this; } public function getComment(): ?string { return $this->comment; } public function setComment(?string $comment): self { $this->comment = $comment; return $this; } public function getJustificatifPath(): ?string { return $this->justificatifPath; } public function setJustificatifPath(?string $justificatifPath): self { $this->justificatifPath = $justificatifPath; return $this; } public function getJustificatifName(): ?string { return $this->justificatifName; } public function setJustificatifName(?string $justificatifName): self { $this->justificatifName = $justificatifName; return $this; } public function getCreatedAt(): DateTimeImmutable { return $this->createdAt; } }