33 lines
795 B
PHP
33 lines
795 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Service\Contracts;
|
|
|
|
use App\Entity\Contract;
|
|
use App\Entity\Employee;
|
|
use App\Entity\EmployeeContractPeriod;
|
|
use App\Enum\ContractNature;
|
|
use DateTimeImmutable;
|
|
|
|
final class EmployeeContractPeriodBuilder
|
|
{
|
|
public function build(
|
|
Employee $employee,
|
|
Contract $contract,
|
|
DateTimeImmutable $startDate,
|
|
?DateTimeImmutable $endDate,
|
|
ContractNature $nature,
|
|
bool $isDriver = false,
|
|
): EmployeeContractPeriod {
|
|
return new EmployeeContractPeriod()
|
|
->setEmployee($employee)
|
|
->setContract($contract)
|
|
->setStartDate($startDate)
|
|
->setEndDate($endDate)
|
|
->setContractNature($nature)
|
|
->setIsDriver($isDriver)
|
|
;
|
|
}
|
|
}
|