ContractNature::CDI->value])] private string $contractNature = ContractNature::CDI->value; #[ORM\Column(type: 'boolean', options: ['default' => false])] private bool $paidLeaveSettled = false; #[ORM\Column(type: 'text', nullable: true)] private ?string $comment = null; /** * @var Collection */ #[ORM\OneToMany(mappedBy: 'contractPeriod', targetEntity: ContractSuspension::class, cascade: ['persist', 'remove'])] private Collection $suspensions; #[ORM\Column(type: 'datetime_immutable')] private DateTimeImmutable $createdAt; public function __construct() { $this->createdAt = new DateTimeImmutable(); $this->startDate = new DateTimeImmutable('today'); $this->suspensions = new ArrayCollection(); } 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 getContract(): ?Contract { return $this->contract; } public function setContract(?Contract $contract): self { $this->contract = $contract; 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 getContractNature(): string { return $this->contractNature; } public function getContractNatureEnum(): ContractNature { return ContractNature::tryFrom($this->contractNature) ?? ContractNature::CDI; } public function setContractNature(ContractNature|string $contractNature): self { $value = $contractNature instanceof ContractNature ? $contractNature->value : $contractNature; $this->contractNature = ContractNature::tryFrom($value)?->value ?? ContractNature::CDI->value; return $this; } public function getCreatedAt(): DateTimeImmutable { return $this->createdAt; } public function isPaidLeaveSettled(): bool { return $this->paidLeaveSettled; } public function setPaidLeaveSettled(bool $paidLeaveSettled): self { $this->paidLeaveSettled = $paidLeaveSettled; return $this; } public function getComment(): ?string { return $this->comment; } public function setComment(?string $comment): self { $this->comment = $comment; return $this; } /** * @return Collection */ public function getSuspensions(): Collection { return $this->suspensions; } }