src/Features/Jobs/JobFilter.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Features\Jobs;
  3. use App\Entity\ActivitySector;
  4. use App\Entity\Applicants;
  5. use App\Entity\Embedded\DateAndTime;
  6. use App\Entity\EmploymentContract;
  7. use App\Entity\StudyLevel;
  8. use Doctrine\Common\Collections\ArrayCollection;
  9. class JobFilter
  10. {
  11.     public ?bool $isEnabled;
  12.     public ?string $query;
  13.     public array|ArrayCollection|null $sectors;
  14.     private array|ArrayCollection|null $studyLevel;
  15.     private ?int $experienceYear;
  16.     private ?DateAndTime $startAt;
  17.     private ?DateAndTime $endAt;
  18.     private ?EmploymentContract $employmentContract;
  19.     private ?\DateTimeImmutable $createdDate;
  20.     private ?Applicants $applicantExist;
  21.     private ?Applicants $applicantNotExist;
  22.     /**
  23.      * @param string|null $query
  24.      * @param array|null $sectors
  25.      * @param array|null $studyLevel
  26.      * @param int|null $experienceYear
  27.      * @param DateAndTime|null $startAt
  28.      * @param DateAndTime|null $endAt
  29.      * @param EmploymentContract|null $employmentContract
  30.      * @param \DateTimeImmutable|null $createdDate
  31.      */
  32.     public function __construct(?string $querynull,
  33.                                 ?array $sectorsnull,
  34.                                 ?array $studyLevelnull,
  35.                                 ?int $experienceYearnull,
  36.                                 ?DateAndTime $startAtnull,
  37.                                 ?DateAndTime $endAtnull,
  38.                                 ?EmploymentContract $employmentContractnull,
  39.                                 ?\DateTimeImmutable $createdDatenull,
  40.                                 ?Applicants $applicantExistnull,
  41.                                 ?Applicants $applicantNotExistnull,
  42.                                 ?bool $isEnablednull)
  43.     {
  44.         $this->query $query;
  45.         $this->sectors $sectors;
  46.         $this->studyLevel $studyLevel;
  47.         $this->experienceYear $experienceYear;
  48.         $this->startAt $startAt;
  49.         $this->endAt $endAt;
  50.         $this->employmentContract $employmentContract;
  51.         $this->createdDate $createdDate;
  52.         $this->applicantExist $applicantExist;
  53.         $this->applicantNotExist $applicantNotExist;
  54.         $this->isEnabled $isEnabled;
  55.     }
  56.     /**
  57.      * @return string|null
  58.      */
  59.     public function getQuery(): ?string
  60.     {
  61.         return $this->query;
  62.     }
  63.     /**
  64.      * @param string|null $query
  65.      * @return JobFilter
  66.      */
  67.     public function setQuery(?string $query): JobFilter
  68.     {
  69.         $this->query $query;
  70.         return $this;
  71.     }
  72.     /**
  73.      * @return array|ArrayCollection|null
  74.      */
  75.     public function getSectors(): ArrayCollection|array|null
  76.     {
  77.         return $this->sectors;
  78.     }
  79.     /**
  80.      * @param array|ActivitySector|ArrayCollection|null $sectors
  81.      * @return JobFilter
  82.      */
  83.     public function setSectors(array|ActivitySector|ArrayCollection|null $sectors): JobFilter
  84.     {
  85.         if($sectors instanceof ActivitySector) {
  86.             $sectors = [$sectors];
  87.         }
  88.         $this->sectors $sectors;
  89.         return $this;
  90.     }
  91.     /**
  92.      * @return array|ArrayCollection|null
  93.      */
  94.     public function getStudyLevel(): ArrayCollection|array|null
  95.     {
  96.         return $this->studyLevel;
  97.     }
  98.     /**
  99.      * @param array|ArrayCollection|StudyLevel|null $studyLevel
  100.      * @return JobFilter
  101.      */
  102.     public function setStudyLevel(array|ArrayCollection|null|StudyLevel $studyLevel): JobFilter
  103.     {
  104.         if($studyLevel instanceof StudyLevel) {
  105.             $studyLevel = [$studyLevel];
  106.         }
  107.         $this->studyLevel $studyLevel;
  108.         return $this;
  109.     }
  110.     /**
  111.      * @return int|null
  112.      */
  113.     public function getExperienceYear(): ?int
  114.     {
  115.         return $this->experienceYear;
  116.     }
  117.     /**
  118.      * @param int|null $experienceYear
  119.      * @return JobFilter
  120.      */
  121.     public function setExperienceYear(?int $experienceYear): JobFilter
  122.     {
  123.         $this->experienceYear $experienceYear;
  124.         return $this;
  125.     }
  126.     /**
  127.      * @return DateAndTime|null
  128.      */
  129.     public function getStartAt(): ?DateAndTime
  130.     {
  131.         return $this->startAt;
  132.     }
  133.     /**
  134.      * @param DateAndTime|null $startAt
  135.      * @return JobFilter
  136.      */
  137.     public function setStartAt(?DateAndTime $startAt): JobFilter
  138.     {
  139.         $this->startAt $startAt;
  140.         return $this;
  141.     }
  142.     /**
  143.      * @return DateAndTime|null
  144.      */
  145.     public function getEndAt(): ?DateAndTime
  146.     {
  147.         return $this->endAt;
  148.     }
  149.     /**
  150.      * @param DateAndTime|null $endAt
  151.      * @return JobFilter
  152.      */
  153.     public function setEndAt(?DateAndTime $endAt): JobFilter
  154.     {
  155.         $this->endAt $endAt;
  156.         return $this;
  157.     }
  158.     /**
  159.      * @return EmploymentContract|null
  160.      */
  161.     public function getEmploymentContract(): ?EmploymentContract
  162.     {
  163.         return $this->employmentContract;
  164.     }
  165.     /**
  166.      * @param EmploymentContract|null $employmentContract
  167.      * @return JobFilter
  168.      */
  169.     public function setEmploymentContract(?EmploymentContract $employmentContract): JobFilter
  170.     {
  171.         $this->employmentContract $employmentContract;
  172.         return $this;
  173.     }
  174.     /**
  175.      * @return \DateTimeImmutable|null
  176.      */
  177.     public function getCreatedDate(): ?\DateTimeImmutable
  178.     {
  179.         return $this->createdDate;
  180.     }
  181.     /**
  182.      * @param \DateTimeImmutable|null $createdDate
  183.      * @return JobFilter
  184.      */
  185.     public function setCreatedDate(?\DateTimeImmutable $createdDate): JobFilter
  186.     {
  187.         $this->createdDate $createdDate;
  188.         return $this;
  189.     }
  190.     /**
  191.      * @return Applicants|null
  192.      */
  193.     public function getApplicantExist(): ?Applicants
  194.     {
  195.         return $this->applicantExist;
  196.     }
  197.     /**
  198.      * @return Applicants|null
  199.      */
  200.     public function getApplicantNotExist(): ?Applicants
  201.     {
  202.         return $this->applicantNotExist;
  203.     }
  204.     /**
  205.      * @param Applicants|null $applicantExist
  206.      * @return JobFilter
  207.      */
  208.     public function setApplicantExist(?Applicants $applicantExist): JobFilter
  209.     {
  210.         $this->applicantExist $applicantExist;
  211.         return $this;
  212.     }
  213.     /**
  214.      * @param Applicants|null $applicantNotExist
  215.      * @return JobFilter
  216.      */
  217.     public function setApplicantNotExist(?Applicants $applicantNotExist): JobFilter
  218.     {
  219.         $this->applicantNotExist $applicantNotExist;
  220.         return $this;
  221.     }
  222.     /**
  223.      * @return bool|null
  224.      */
  225.     public function getIsEnabled(): ?bool
  226.     {
  227.         return $this->isEnabled;
  228.     }
  229.     /**
  230.      * @param bool|null $isEnabled
  231.      * @return JobFilter
  232.      */
  233.     public function setIsEnabled(?bool $isEnabled): JobFilter
  234.     {
  235.         $this->isEnabled $isEnabled;
  236.         return $this;
  237.     }
  238. }