src/Entity/CRM/EmploymentContractType.php line 13

  1. <?php
  2. namespace App\Entity\CRM;
  3. use App\Repository\EmploymentContractTypeRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\DBAL\Types\Types;
  7. use Doctrine\ORM\Mapping as ORM;
  8. #[ORM\Entity(repositoryClassEmploymentContractTypeRepository::class)]
  9. #[ORM\Table(name'consultant_contract_type')]
  10. class EmploymentContractType
  11. {
  12.     #[ORM\Id]
  13.     #[ORM\GeneratedValue]
  14.     #[ORM\Column]
  15.     private ?int $id null;
  16.     #[ORM\Column(length255)]
  17.     private ?string $name null;
  18.     #[ORM\Column(typeTypes::TIME_MUTABLEnullabletrue)]
  19.     private ?\DateTimeInterface $defaultWorkStart null;
  20.     #[ORM\Column(typeTypes::TIME_MUTABLEnullabletrue)]
  21.     private ?\DateTimeInterface $defaultWorkEnd null;
  22.     #[ORM\OneToMany(mappedBy'consultantContractType'targetEntityConsultant::class)]
  23.     private Collection $consultants;
  24.     #[ORM\Column]
  25.     private ?int $defaultEmploymentFactor null;
  26.     #[ORM\OneToMany(mappedBy'adminContractType'targetEntityAdmin::class)]
  27.     private Collection $admins;
  28.     #[ORM\Column]
  29.     private ?float $multiplier null;
  30.     public function __construct()
  31.     {
  32.         $this->consultants = new ArrayCollection();
  33.         $this->admins = new ArrayCollection();
  34.     }
  35.     public function __toString(): string
  36.     {
  37.         return $this->name;
  38.     }
  39.     public function getId(): ?int
  40.     {
  41.         return $this->id;
  42.     }
  43.     public function getName(): ?string
  44.     {
  45.         return $this->name;
  46.     }
  47.     public function setName(string $name): static
  48.     {
  49.         $this->name $name;
  50.         return $this;
  51.     }
  52.     public function getDefaultWorkStart(): ?\DateTimeInterface
  53.     {
  54.         return $this->defaultWorkStart;
  55.     }
  56.     public function setDefaultWorkStart(?\DateTimeInterface $defaultWorkStart): static
  57.     {
  58.         $this->defaultWorkStart $defaultWorkStart;
  59.         return $this;
  60.     }
  61.     public function getDefaultWorkEnd(): ?\DateTimeInterface
  62.     {
  63.         return $this->defaultWorkEnd;
  64.     }
  65.     public function setDefaultWorkEnd(?\DateTimeInterface $defaultWorkEnd): static
  66.     {
  67.         $this->defaultWorkEnd $defaultWorkEnd;
  68.         return $this;
  69.     }
  70.     /**
  71.      * @return Collection<int, Consultant>
  72.      */
  73.     public function getConsultants(): Collection
  74.     {
  75.         return $this->consultants;
  76.     }
  77.     public function addConsultant(Consultant $consultant): static
  78.     {
  79.         if (!$this->consultants->contains($consultant)) {
  80.             $this->consultants->add($consultant);
  81.             $consultant->setConsultantContractType($this);
  82.         }
  83.         return $this;
  84.     }
  85.     public function removeConsultant(Consultant $consultant): static
  86.     {
  87.         if ($this->consultants->removeElement($consultant)) {
  88.             // set the owning side to null (unless already changed)
  89.             if ($consultant->getConsultantContractType() === $this) {
  90.                 $consultant->setConsultantContractType(null);
  91.             }
  92.         }
  93.         return $this;
  94.     }
  95.     public function getDefaultEmploymentFactor(): ?int
  96.     {
  97.         return $this->defaultEmploymentFactor;
  98.     }
  99.     public function setDefaultEmploymentFactor(int $defaultEmploymentFactor): static
  100.     {
  101.         $this->defaultEmploymentFactor $defaultEmploymentFactor;
  102.         return $this;
  103.     }
  104.     /**
  105.      * @return Collection<int, Admin>
  106.      */
  107.     public function getAdmins(): Collection
  108.     {
  109.         return $this->admins;
  110.     }
  111.     public function addAdmin(Admin $admin): static
  112.     {
  113.         if (!$this->admins->contains($admin)) {
  114.             $this->admins->add($admin);
  115.             $admin->setAdminContractType($this);
  116.         }
  117.         return $this;
  118.     }
  119.     public function removeAdmin(Admin $admin): static
  120.     {
  121.         if ($this->admins->removeElement($admin)) {
  122.             // set the owning side to null (unless already changed)
  123.             if ($admin->getAdminContractType() === $this) {
  124.                 $admin->setAdminContractType(null);
  125.             }
  126.         }
  127.         return $this;
  128.     }
  129.     public function getMultiplier(): ?float
  130.     {
  131.         return $this->multiplier;
  132.     }
  133.     public function setMultiplier(float $multiplier): static
  134.     {
  135.         $this->multiplier $multiplier;
  136.         return $this;
  137.     }
  138. }