src/Entity/Contract.php line 13

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ContractRepository;
  4. use App\Trait\DateTrait;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\DBAL\Types\Types;
  8. use Doctrine\ORM\Mapping as ORM;
  9. #[ORM\Entity(repositoryClassContractRepository::class)]
  10. class Contract
  11. {
  12.     use DateTraitDateTrait::__construct as dateConstruct;}
  13.     const TYPE_CDD 'contract.type.cdd';
  14.     const TYPE_CDI 'contract.type.cdi';
  15.     const TYPE_STAGE 'contract.type.stage';
  16.     #[ORM\Id]
  17.     #[ORM\GeneratedValue]
  18.     #[ORM\Column]
  19.     private ?int $id null;
  20.     #[ORM\Column(length255)]
  21.     private ?string $title null;
  22.     #[ORM\Column(typeTypes::TEXT)]
  23.     private ?string $content null;
  24.     #[ORM\ManyToOne(inversedBy'contracts')]
  25.     private ?Establishment $establishment null;
  26.     #[ORM\Column(length255nullabletrue)]
  27.     private ?string $function null;
  28.     #[ORM\Column(length50)]
  29.     private ?string $type null;
  30.     #[ORM\Column(nullabletrue)]
  31.     private ?int $delay null;
  32.     #[ORM\Column(nullabletrue)]
  33.     private ?float $salary null;
  34.     #[ORM\ManyToOne]
  35.     private ?Currency $currency null;
  36.     public function __construct()
  37.     {
  38.         $this->dateConstruct();
  39.         $this->employees = new ArrayCollection();
  40.     }
  41.     public static function getContractTypes()
  42.     {
  43.         return [
  44.             self::TYPE_CDD,
  45.             self::TYPE_CDI,
  46.             self::TYPE_STAGE,
  47.         ];
  48.     }
  49.     public function getId(): ?int
  50.     {
  51.         return $this->id;
  52.     }
  53.     public function getTitle(): ?string
  54.     {
  55.         return $this->title;
  56.     }
  57.     public function setTitle(string $title): static
  58.     {
  59.         $this->title $title;
  60.         return $this;
  61.     }
  62.     public function getContent(): ?string
  63.     {
  64.         return $this->content;
  65.     }
  66.     public function setContent(string $content): static
  67.     {
  68.         $this->content $content;
  69.         return $this;
  70.     }
  71.     public function getEstablishment(): ?Establishment
  72.     {
  73.         return $this->establishment;
  74.     }
  75.     public function setEstablishment(?Establishment $establishment): static
  76.     {
  77.         $this->establishment $establishment;
  78.         return $this;
  79.     }
  80.     public function getFunction(): ?string
  81.     {
  82.         return $this->function;
  83.     }
  84.     public function setFunction(?string $function): static
  85.     {
  86.         $this->function $function;
  87.         return $this;
  88.     }
  89.     public function getType(): ?string
  90.     {
  91.         return $this->type;
  92.     }
  93.     public function setType(string $type): static
  94.     {
  95.         $this->type $type;
  96.         return $this;
  97.     }
  98.     public function getDelay(): ?int
  99.     {
  100.         return $this->delay;
  101.     }
  102.     public function setDelay(?int $delay): static
  103.     {
  104.         $this->delay $delay;
  105.         return $this;
  106.     }
  107.     public function getSalary(): ?float
  108.     {
  109.         return $this->salary;
  110.     }
  111.     public function setSalary(?float $salary): static
  112.     {
  113.         $this->salary $salary;
  114.         return $this;
  115.     }
  116.     public function getCurrency(): ?Currency
  117.     {
  118.         return $this->currency;
  119.     }
  120.     public function setCurrency(?Currency $currency): static
  121.     {
  122.         $this->currency $currency;
  123.         return $this;
  124.     }
  125. }