feat : ajout des suspensions et des jours de présence
Some checks failed
Auto Tag Develop / tag (push) Has been cancelled
Some checks failed
Auto Tag Develop / tag (push) Has been cancelled
This commit is contained in:
@@ -7,6 +7,8 @@ namespace App\Entity;
|
||||
use App\Enum\ContractNature;
|
||||
use App\Repository\EmployeeContractPeriodRepository;
|
||||
use DateTimeImmutable;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#[ORM\Entity(repositoryClass: EmployeeContractPeriodRepository::class)]
|
||||
@@ -43,13 +45,20 @@ class EmployeeContractPeriod
|
||||
#[ORM\Column(type: 'text', nullable: true)]
|
||||
private ?string $comment = null;
|
||||
|
||||
/**
|
||||
* @var Collection<int, ContractSuspension>
|
||||
*/
|
||||
#[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->createdAt = new DateTimeImmutable();
|
||||
$this->startDate = new DateTimeImmutable('today');
|
||||
$this->suspensions = new ArrayCollection();
|
||||
}
|
||||
|
||||
public function getId(): ?int
|
||||
@@ -151,4 +160,12 @@ class EmployeeContractPeriod
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection<int, ContractSuspension>
|
||||
*/
|
||||
public function getSuspensions(): Collection
|
||||
{
|
||||
return $this->suspensions;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user