src/Entity/EmployeeContract.php line 10

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\EmployeeContractRepository;
  4. use App\Trait\DateTrait;
  5. use Doctrine\ORM\Mapping as ORM;
  6. #[ORM\Entity(repositoryClassEmployeeContractRepository::class)]
  7. class EmployeeContract
  8. {
  9.     use DateTraitDateTrait::__construct as dateConstruct;}
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column]
  13.     private ?int $id null;
  14.     #[ORM\ManyToOne(inversedBy'contracts')]
  15.     #[ORM\JoinColumn(nullablefalse)]
  16.     private ?Employee $employee null;
  17.     #[ORM\Column(length50)]
  18.     private ?string $type null;
  19.     #[ORM\Column]
  20.     private ?float $salary null;
  21.     #[ORM\ManyToOne]
  22.     #[ORM\JoinColumn(nullablefalse)]
  23.     private ?Currency $currency null;
  24.     #[ORM\ManyToOne]
  25.     #[ORM\JoinColumn(nullablefalse)]
  26.     private ?Contact $contract null;
  27.     #[ORM\Column]
  28.     private ?\DateTimeImmutable $startedAt null;
  29.     #[ORM\Column]
  30.     private ?\DateTimeImmutable $finishedAt null;
  31.     public function __construct()
  32.     {
  33.         $this->dateConstruct();
  34.     }
  35.     public function getId(): ?int
  36.     {
  37.         return $this->id;
  38.     }
  39.     public function getEmployee(): ?Employee
  40.     {
  41.         return $this->employee;
  42.     }
  43.     public function setEmployee(?Employee $employee): static
  44.     {
  45.         $this->employee $employee;
  46.         return $this;
  47.     }
  48.     public function getType(): ?string
  49.     {
  50.         return $this->type;
  51.     }
  52.     public function setType(string $type): static
  53.     {
  54.         $this->type $type;
  55.         return $this;
  56.     }
  57.     public function getSalary(): ?float
  58.     {
  59.         return $this->salary;
  60.     }
  61.     public function setSalary(float $salary): static
  62.     {
  63.         $this->salary $salary;
  64.         return $this;
  65.     }
  66.     public function getCurrency(): ?Currency
  67.     {
  68.         return $this->currency;
  69.     }
  70.     public function setCurrency(?Currency $currency): static
  71.     {
  72.         $this->currency $currency;
  73.         return $this;
  74.     }
  75.     public function getContract(): ?Contact
  76.     {
  77.         return $this->contract;
  78.     }
  79.     public function setContract(?Contact $contract): static
  80.     {
  81.         $this->contract $contract;
  82.         return $this;
  83.     }
  84.     public function getStartedAt(): ?\DateTimeImmutable
  85.     {
  86.         return $this->startedAt;
  87.     }
  88.     public function setStartedAt(\DateTimeImmutable $startedAt): static
  89.     {
  90.         $this->startedAt $startedAt;
  91.         return $this;
  92.     }
  93.     public function getFinishedAt(): ?\DateTimeImmutable
  94.     {
  95.         return $this->finishedAt;
  96.     }
  97.     public function setFinishedAt(\DateTimeImmutable $finishedAt): static
  98.     {
  99.         $this->finishedAt $finishedAt;
  100.         return $this;
  101.     }
  102. }