src/Entity/JobPosition.php line 1022

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use phpDocumentor\Reflection\Types\Integer;
  7. use Symfony\Component\Validator\Constraints as Assert;
  8. use Symfony\Component\Validator\Exception\ValidatorException;
  9. use App\Utils\File\FileServiceTrait;
  10. use Symfony\Component\HttpFoundation\File\UploadedFile;
  11. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  12. /**
  13.  * @ORM\Entity(repositoryClass="App\Repository\JobPositionRepository")
  14.  * @Vich\Uploadable
  15.  */
  16. class JobPosition implements \JsonSerializable
  17. {
  18.     use FileServiceTrait;
  19.     
  20.     public  $targetDirectory;
  21.     const FILE_PICTURE = "sharePicture";
  22.     const FILE_LOGO = "additionalLogo";
  23.     const FILES = [
  24.         self::FILE_PICTURE => [
  25.             'types' => ['gif', 'jpg', 'jpeg', 'png', 'tif', 'svg'],
  26.             'dir' => '/job_position_picture',
  27.             'size' => 5*1024*1024,
  28.         ],
  29.         self::FILE_LOGO => [
  30.             'types' => ['gif', 'jpg', 'jpeg', 'png', 'tif', 'svg'],
  31.             'dir' => '/company_logo',
  32.             'size' => 5*1024*1024,
  33.         ],
  34.     ];
  35.     const APPLYING_TYPE_INTERNAL = 1;
  36.     const APPLYING_TYPE_EXTERNAL = 2;
  37.     const APPLYING_TYPES = [
  38.         self::APPLYING_TYPE_INTERNAL => "Internal",
  39.         self::APPLYING_TYPE_EXTERNAL => "External"
  40.     ];
  41.     const JOB_SUB_TYPE_CHOOSE = 0;
  42.     const JOB_SUB_TYPE_REMOTE = 1;
  43.     const JOB_SUB_TYPE_HYBRID = 2;
  44.     const JOB_SUB_TYPE_REGULAR = 3;
  45.     const JOB_SUB_TYPES = [
  46.         self::JOB_SUB_TYPE_CHOOSE => "Choose",
  47.         self::JOB_SUB_TYPE_REMOTE => "Remote",
  48.         self::JOB_SUB_TYPE_HYBRID => "Hybrid",
  49.         self::JOB_SUB_TYPE_REGULAR => "Regular"
  50.     ];
  51.     const JOB_SALARY_CHOOSE = 0;
  52.     const JOB_SALARY_YES = 1;
  53.     const JOB_SALARY_NO = 2;
  54.     const JOB_SALARY = [
  55.         self::JOB_SALARY_CHOOSE => "Choose",
  56.         self::JOB_SALARY_YES => "Yes",
  57.         self::JOB_SALARY_NO => "No",
  58.     ];
  59.     const JOB_APPLICANTS_CHOOSE = 0;
  60.     const JOB_APPLICANTS_MIN = 1;
  61.     const JOB_APPLICANTS_MAX = 2;
  62.     const JOB_APPLICANTS = [
  63.         self::JOB_APPLICANTS_CHOOSE => "Choose",
  64.         self::JOB_APPLICANTS_MIN => "Min",
  65.         self::JOB_APPLICANTS_MAX => "Max",
  66.     ];
  67.     const STATUS_DRAFT = 1;
  68.     const STATUS_ACTIVE = 2;
  69.     const STATUS_INACTIVE = 3;
  70.     const STATUS_EXPIRED = 4;
  71.     const STATUS_DELETED = 5;
  72.     const STATUSES = [
  73.         self::STATUS_DRAFT => "Draft",
  74.         self::STATUS_ACTIVE => "Active",
  75.         self::STATUS_INACTIVE => "Inactive",
  76.         self::STATUS_EXPIRED => "Expired",
  77.         self::STATUS_DELETED => "Deleted"
  78.     ];
  79.     const VALID_IN_DAYS = 30;
  80.     /**
  81.      * @ORM\Id()
  82.      * @ORM\GeneratedValue()
  83.      * @ORM\Column(type="integer")
  84.      */
  85.     public $id;
  86.     /**
  87.      * @ORM\ManyToOne(targetEntity="App\Entity\Company", inversedBy="jobPositions")
  88.      * @ORM\JoinColumn(nullable=false)
  89.      */
  90.     public $company;
  91.     /**
  92.      * @ORM\Column(type="string", length=255)
  93.      */
  94.     public $title;
  95.     /**
  96.      * @ORM\ManyToMany(targetEntity="App\Entity\Department")
  97.      * @ORM\JoinColumn(nullable=false)
  98.      */
  99.     public $department;
  100.     /**
  101.      * @ORM\Column(type="string", length=255, nullable=true)
  102.      */
  103.     public $refNumber;
  104.     /**
  105.      * @ORM\Column(type="text", nullable=false)
  106.      */
  107.     private $description;
  108.     /**
  109.      * @ORM\Column(type="string", length=255, nullable=true)
  110.      */
  111.     private $location;
  112.     /**
  113.      * @ORM\ManyToOne(targetEntity="App\Entity\City")
  114.      * @ORM\JoinColumn(nullable=false)
  115.      */
  116.     private $city;
  117.     /**
  118.      * @ORM\ManyToOne(targetEntity="App\Entity\JobType", inversedBy="jobPositions")
  119.      * @ORM\JoinColumn(nullable=false)
  120.      */
  121.     private $jobType;
  122.     /**
  123.      * @ORM\ManyToOne(targetEntity="App\Entity\JobSubType", inversedBy="jobPositions")
  124.      * @ORM\JoinColumn(nullable=false)
  125.      */
  126.     private $jobSubType;
  127.     /**
  128.      * @ORM\ManyToOne(targetEntity="App\Entity\PositionLevel", inversedBy="jobPositions")
  129.      * @ORM\JoinColumn(nullable=false)
  130.      */
  131.     private $positionLevel;
  132.     /**
  133.      * @ORM\Column(type="string", length=255, nullable=true)
  134.      */
  135.     private $workingHours;
  136.     /**
  137.      * @ORM\ManyToMany(targetEntity="App\Entity\Skill")
  138.      */
  139.     private $skills;
  140.     /**
  141.      * @ORM\ManyToMany(targetEntity="App\Entity\Language")
  142.      */
  143.     private $languages;
  144.     /**
  145.      * @ORM\Column(type="integer", nullable=false)
  146.      */
  147.     private $applyingType;
  148.     /**
  149.      * @ORM\Column(type="string", length=255, nullable=true)
  150.      */
  151.     private $applyingUrl;
  152.     /**
  153.      * @ORM\ManyToMany(targetEntity="App\Entity\ApplyingDocument")
  154.      */
  155.     private $requiredDocuments;
  156.     /**
  157.      * @ORM\Column(type="datetime", options={"default": "CURRENT_TIMESTAMP"})
  158.      */
  159.     private $createdAt;
  160.     /**
  161.      * @ORM\Column(type="datetime", nullable=true)
  162.      */
  163.     private $publishedAt;
  164.     /**
  165.      * @ORM\Column(type="date", nullable=true)
  166.      */
  167.     private $validTo;
  168.     /**
  169.      * @ORM\Column(type="boolean", options={"default":"0"})
  170.      */
  171.     public $featured = FALSE;
  172.     /**
  173.      * @ORM\Column(type="boolean", options={"default":"0"})
  174.      */
  175.     public $companyFeatured = FALSE;
  176.     /**
  177.      * @ORM\OneToMany(targetEntity="App\Entity\JobApply", mappedBy="jobPosition")
  178.      */
  179.     public $applicants;
  180.     /**
  181.      * @ORM\Column(type="string", length=255, nullable=true)
  182.      */
  183.     private $slug;
  184.     /**
  185.      * @ORM\Column(type="boolean", options={"default":"0"})
  186.      */
  187.     public $promoted = FALSE;
  188.      /**
  189.      * @ORM\Column(type="boolean", options={"default":"0"})
  190.      */
  191.     public $alreadyPromoted = FALSE;
  192.     /**
  193.      * @ORM\Column(type="integer")
  194.      */
  195.     private $status;
  196.     /**
  197.      * @ORM\Column(type="integer", nullable=true),
  198.      */
  199.     private $totalViews;
  200.     /**
  201.      * @ORM\Column(type="string", length=255, nullable=true)
  202.      */
  203.     private $secondaryEmail;
  204.     /**
  205.      * @ORM\Column(type="integer", nullable=true)
  206.      */
  207.     private $minSalary;
  208.     /**
  209.      * @ORM\Column(type="integer", nullable=true)
  210.      */
  211.     private $maxSalary;
  212.     /**
  213.      * @ORM\Column(name="latitude", type="decimal", precision=20, scale=16)
  214.      */
  215.     private $latitude;
  216.     /**
  217.      * @ORM\Column(name="longitude", type="decimal", precision=20, scale=16)
  218.      */
  219.     private $longitude;
  220.     /**
  221.      * @ORM\Column(type="string", length=255, nullable=true)
  222.      * @var string|null
  223.      */
  224.     private $pictureThumbnail;
  225.     /**
  226.     * @Vich\UploadableField(mapping="thumbnails", fileNameProperty="pictureThumbnail")
  227.     * @var File|null
  228.     */
  229.    private $pictureImageFile;
  230.     /**
  231.     * @ORM\Column(type="string", length=255, nullable=true)
  232.     * @var string|null
  233.     */
  234.    private $logoThumbnail;
  235.     /**
  236.     * @Vich\UploadableField(mapping="thumbnails", fileNameProperty="logoThumbnail")
  237.     * @var File|null
  238.     */
  239.    private $logoImageFile;
  240.    /**
  241.     * @ORM\Column(type="datetime", nullable=true)
  242.     */
  243.    private $updatedAt;
  244.     public function __construct()
  245.     {
  246.         $this->setCreatedAt(new \DateTime());
  247.         $this->setStatus(self::STATUS_DRAFT);
  248.         $this->department = new ArrayCollection();
  249.         $this->skills = new ArrayCollection();
  250.         $this->languages = new ArrayCollection();
  251.         $this->requiredDocuments = new ArrayCollection();
  252.         $this->applicants = new ArrayCollection();
  253.     }
  254.     public function getId(): ?int
  255.     {
  256.         return $this->id;
  257.     }
  258.     /**
  259.      * @return Company
  260.      */
  261.     public function getCompany(): ?Company {
  262.         return $this->company;
  263.     }
  264.     /**
  265.      * @param Company $company
  266.      *
  267.      * @return JobPosition
  268.      */
  269.     public function setCompany(Company $company): self {
  270.         $this->company = $company;
  271.         return $this;
  272.     }
  273.     public function getTitle(): ?string
  274.     {
  275.         return $this->title;
  276.     }
  277.     public function setTitle(string $title): self
  278.     {
  279.         $this->title = $title;
  280.         return $this;
  281.     }
  282.     /**
  283.      * @return Collection|Department[]
  284.      */
  285.     public function getDepartments(): Collection
  286.     {
  287.         return $this->department;
  288.     }
  289.     public function addDepartment(Department $department): self
  290.     {
  291.         if (!$this->department->contains($department)) {
  292.             $this->department[] = $department;
  293.         }
  294.         return $this;
  295.     }
  296.     public function removeDepartment(Department $department): self
  297.     {
  298.         if ($this->department->contains($department)) {
  299.             $this->department->removeElement($department);
  300.         }
  301.         return $this;
  302.     }
  303.     public function setDepartments(ArrayCollection $departments): self
  304.     {
  305.         $this->department = $departments;
  306.         return $this;
  307.     }
  308.     public function getRefNumber(): ?string
  309.     {
  310.         return $this->refNumber;
  311.     }
  312.     public function setRefNumber(?string $refNumber): self
  313.     {
  314.         $this->refNumber = $refNumber;
  315.         return $this;
  316.     }
  317.     public function getDescription(): ?string
  318.     {
  319.         return $this->description;
  320.     }
  321.     public function setDescription(?string $description): self
  322.     {
  323.         $this->description = $description;
  324.         return $this;
  325.     }
  326.     public function getLocation(): ?string
  327.     {
  328.         return $this->location;
  329.     }
  330.     public function setLocation(?string $location): self
  331.     {
  332.         $this->location = $location;
  333.         return $this;
  334.     }
  335.     public function getCity(): ?City
  336.     {
  337.         return $this->city;
  338.     }
  339.     public function setCity(City $city): self
  340.     {
  341.         $this->city = $city;
  342.         return $this;
  343.     }
  344.     public function getJobType(): ?JobType
  345.     {
  346.         return $this->jobType;
  347.     }
  348.     public function setJobType(JobType $jobType): self
  349.     {
  350.         $this->jobType = $jobType;
  351.         return $this;
  352.     }
  353.     public function getJobSubType(): ?JobSubType
  354.     {
  355.         return $this->jobSubType;
  356.     }
  357.     public function setJobSubType(?JobSubType $jobSubType): self
  358.     {
  359.         $this->jobSubType = $jobSubType;
  360.         return $this;
  361.     }
  362.     public function getPositionLevel(): ?PositionLevel
  363.     {
  364.         return $this->positionLevel;
  365.     }
  366.     public function setPositionLevel(PositionLevel $positionLevel): self
  367.     {
  368.         $this->positionLevel = $positionLevel;
  369.         return $this;
  370.     }
  371.     public function getWorkingHours(): ?string
  372.     {
  373.         return $this->workingHours;
  374.     }
  375.     public function setWorkingHours(?string $workingHours): self
  376.     {
  377.         $this->workingHours = $workingHours;
  378.         return $this;
  379.     }
  380.     /**
  381.      * @return Collection|Skill[]
  382.      */
  383.     public function getSkills(): Collection
  384.     {
  385.         return $this->skills;
  386.     }
  387.     public function addSkill(Skill $skill): self
  388.     {
  389.         if (!$this->skills->contains($skill)) {
  390.             $this->skills[] = $skill;
  391.         }
  392.         return $this;
  393.     }
  394.     public function removeSkill(Skill $skill): self
  395.     {
  396.         if ($this->skills->contains($skill)) {
  397.             $this->skills->removeElement($skill);
  398.         }
  399.         return $this;
  400.     }
  401.     public function setSkills(ArrayCollection $skills): self
  402.     {
  403.         $this->skills = $skills;
  404.         return $this;
  405.     }
  406.     /**
  407.      * @return Collection|Language[]
  408.      */
  409.     public function getLanguages(): Collection
  410.     {
  411.         return $this->languages;
  412.     }
  413.     public function addLanguage(Language $language): self
  414.     {
  415.         if (!$this->languages->contains($language)) {
  416.             $this->languages[] = $language;
  417.         }
  418.         return $this;
  419.     }
  420.     public function removeLanguage(Language $language): self
  421.     {
  422.         if ($this->languages->contains($language)) {
  423.             $this->languages->removeElement($language);
  424.         }
  425.         return $this;
  426.     }
  427.     public function setLanguages(ArrayCollection $languages): self
  428.     {
  429.         $this->languages = $languages;
  430.         return $this;
  431.     }
  432.     public function getApplyingType(): ?int
  433.     {
  434.         return $this->applyingType;
  435.     }
  436.     public function setApplyingType(int $applyingType): self
  437.     {
  438.         if(!array_key_exists($applyingType, self::APPLYING_TYPES)){
  439.             throw new ValidatorException("Job position applying type is now valid");
  440.         }
  441.         $this->applyingType = $applyingType;
  442.         return $this;
  443.     }
  444.     public function getApplyingUrl(): ?string
  445.     {
  446.         return $this->applyingUrl;
  447.     }
  448.     public function setApplyingUrl(?string $applyingUrl): self
  449.     {
  450.         $this->applyingUrl = $applyingUrl;
  451.         return $this;
  452.     }
  453.     /**
  454.      * @return Collection|ApplyingDocument[]
  455.      */
  456.     public function getRequiredDocuments(): Collection
  457.     {
  458.         return $this->requiredDocuments;
  459.     }
  460.     public function addRequiredDocument(ApplyingDocument $requiredDocument): self
  461.     {
  462.         if (!$this->requiredDocuments->contains($requiredDocument)) {
  463.             $this->requiredDocuments[] = $requiredDocument;
  464.         }
  465.         return $this;
  466.     }
  467.     public function removeRequiredDocument(ApplyingDocument $requiredDocument): self
  468.     {
  469.         if ($this->requiredDocuments->contains($requiredDocument)) {
  470.             $this->requiredDocuments->removeElement($requiredDocument);
  471.         }
  472.         return $this;
  473.     }
  474.     public function setRequiredDocuments(ArrayCollection $requiredDocuments): self
  475.     {
  476.         $this->requiredDocuments = $requiredDocuments;
  477.         return $this;
  478.     }
  479.     /**
  480.      * @return \DateTime
  481.      */
  482.     public function getCreatedAt(): \DateTime {
  483.         return $this->createdAt;
  484.     }
  485.     /**
  486.      * @param \DateTime $createdAt
  487.      *
  488.      * @return JobPosition
  489.      */
  490.     public function setCreatedAt(\DateTime $createdAt): self {
  491.         $this->createdAt = $createdAt;
  492.         return $this;
  493.     }
  494.     /**
  495.      * @return null|\DateTime
  496.      */
  497.     public function getPublishedAt(): ?\DateTime {
  498.         return $this->publishedAt;
  499.     }
  500.     /**
  501.      * @param null|\DateTime $publishedAt
  502.      *
  503.      * @return JobPosition
  504.      */
  505.     public function setPublishedAt(?\DateTime $publishedAt): self {
  506.         $this->publishedAt = $publishedAt;
  507.         return $this;
  508.     }
  509.     /**
  510.      * @return \DateTime
  511.      */
  512.     public function getValidTo(): ?\DateTime {
  513.         return $this->validTo;
  514.     }
  515.     /**
  516.      * @param \DateTime $validTo
  517.      *
  518.      * @return JobPosition
  519.      */
  520.     public function setValidTo(?\DateTime $validTo): self {
  521.         $this->validTo = $validTo;
  522.         return $this;
  523.     }
  524.     /**
  525.      * @return bool
  526.      */
  527.     public function getFeatured(): bool {
  528.         return $this->featured;
  529.     }
  530.     /**
  531.      * @param bool $featured
  532.      *
  533.      * @return JobPosition
  534.      */
  535.     public function setFeatured(bool $featured): self {
  536.         $this->featured = $featured;
  537.         return $this;
  538.     }
  539.     /**
  540.      * @return bool
  541.      */
  542.     public function getCompanyFeatured(): bool {
  543.         return $this->companyFeatured;
  544.     }
  545.     /**
  546.      * @param bool $companyFeatured
  547.      *
  548.      * @return JobPosition
  549.      */
  550.     public function setCompanyFeatured(bool $companyFeatured): self {
  551.         $this->companyFeatured = $companyFeatured;
  552.         return $this;
  553.     }
  554.     public function getStatus(): ?int
  555.     {
  556.         return $this->status;
  557.     }
  558.     public function setStatus(int $status): self
  559.     {
  560.         if(!array_key_exists($status, self::STATUSES)){
  561.             throw new ValidatorException("Job position status is not valid");
  562.         }
  563.         $this->status = $status;
  564.         return $this;
  565.     }
  566.     public function getTotalViews(): ?int
  567.     {
  568.         return $this->totalViews;
  569.     }
  570.     public function setTotalViews($views): self
  571.     {
  572.         $this->totalViews += $views;
  573.         return $this;
  574.     }
  575.     /**
  576.      * @return Collection|JobApply[]
  577.      */
  578.     public function getApplicants() {
  579.         return $this->applicants;
  580.     }
  581.     /**
  582.      * @return string|null
  583.      */
  584.     public function getSlug(): ?string
  585.     {
  586.         return $this->slug;
  587.     }
  588.     /**
  589.      * @param string $slug
  590.      *
  591.      * @return self
  592.      */
  593.     public function setSlug(string $slug): self
  594.     {
  595.         $this->slug = $slug;
  596.         return $this;
  597.     }
  598.     /**
  599.      * @return bool
  600.      */
  601.     public function getPromoted(): bool {
  602.         return $this->promoted;
  603.     }
  604.     /**
  605.      * @param bool $promoted
  606.      *
  607.      * @return JobPosition
  608.      */
  609.     public function setPromoted(bool $promoted): self {
  610.         $this->promoted = $promoted;
  611.         return $this;
  612.     }
  613.     /**
  614.      * @return bool
  615.      */
  616.     public function getAlreadyPromoted(): bool {
  617.         return $this->alreadyPromoted;
  618.     }
  619.     /**
  620.      * @param bool $promoted
  621.      *
  622.      * @return JobPosition
  623.      */
  624.     public function setAlreadyPromoted(bool $alreadyPromoted): self {
  625.         $this->alreadyPromoted = $alreadyPromoted;
  626.         return $this;
  627.     }
  628.     public function getMinSalary(): ?int
  629.     {
  630.         return $this->minSalary;
  631.     }
  632.     public function setMinSalary(?int $minSalary): self
  633.     {
  634.         $this->minSalary = $minSalary;
  635.         return $this;
  636.     }
  637.     public function getMaxSalary(): ?int
  638.     {
  639.         return $this->maxSalary;
  640.     }
  641.     public function setMaxSalary(?int $maxSalary): self
  642.     {
  643.         $this->maxSalary = $maxSalary;
  644.         return $this;
  645.     }
  646.     public function getLatitude(): ?string
  647.     {
  648.         return $this->latitude;
  649.     }
  650.     public function setLatitude(?string $latitude): self
  651.     {
  652.         $this->latitude = $latitude;
  653.         return $this;
  654.     }
  655.     public function getLongitude(): ?string
  656.     {
  657.         return $this->longitude;
  658.     }
  659.     public function setLongitude(?string $longitude): self
  660.     {
  661.         $this->longitude = $longitude;
  662.         return $this;
  663.     }
  664.     /**
  665.      * @param JobApply $jobApply
  666.      *
  667.      * @return JobPosition
  668.      */
  669.     public function addJobPosition(JobApply $jobApply): self
  670.     {
  671.         if (!$this->applicants->contains($jobApply)) {
  672.             $this->applicants[] = $jobApply;
  673.         }
  674.         return $this;
  675.     }
  676.     /**
  677.      * @param JobApply $jobApply
  678.      *
  679.      * @return JobPosition
  680.      */
  681.     public function removeJobPosition(JobApply $jobApply): self
  682.     {
  683.         if ($this->applicants->contains($jobApply)) {
  684.             $this->applicants->removeElement($jobApply);
  685.         }
  686.         return $this;
  687.     }
  688.     public function __toString() {
  689.         return $this->getTitle();
  690.     }
  691.     public function getSecondaryEmail(): ?string
  692.     {
  693.         return $this->secondaryEmail;
  694.     }
  695.     public function setSecondaryEmail(?string $secondaryEmail): self
  696.     {
  697.         $this->secondaryEmail = $secondaryEmail;
  698.         return $this;
  699.     }
  700.     public function getPicture(){
  701.         return $this->getFileService()->getFile($this, self::FILE_PICTURE);
  702.     }
  703.     public function setPicture(?UploadedFile $file){
  704.         if($file) {
  705.             $oldFile = $this->getFileService()->getFile($this, self::FILE_PICTURE);
  706.             $newFile = $this->getFileService()->upload($file, $this, self::FILE_PICTURE);
  707.             if($newFile && $oldFile){
  708.                 $this->getFileService()->delete($oldFile);
  709.             }
  710.         }
  711.         return $this;
  712.     }
  713.     public function removePicture(){
  714.         $file = $this->getFileService()->getFile($this, self::FILE_PICTURE);
  715.         if($file) {
  716.             $this->getFileService()->delete($file);
  717.         }
  718.         return $this;
  719.     }
  720.     public function getLogo(){
  721.         return $this->getFileService()->getFile($this, self::FILE_LOGO);
  722.     }
  723.     public function setLogo(?UploadedFile $file){
  724.         if($file) {
  725.             $oldFile = $this->getFileService()->getFile($this, self::FILE_LOGO);
  726.             $newFile = $this->getFileService()->upload($file, $this, self::FILE_LOGO);
  727.             if($newFile && $oldFile){
  728.                 $this->getFileService()->delete($oldFile);
  729.             }
  730.         }
  731.         return $this;
  732.     }
  733.     public function removeLogo(){
  734.         $file = $this->getFileService()->getFile($this, self::FILE_LOGO);
  735.         if($file) {
  736.             $this->getFileService()->delete($file);
  737.         }
  738.         return $this;
  739.     }
  740.      /**
  741.      * Get the value of pictureThumbnail
  742.      *
  743.      * @return  string|null
  744.      */ 
  745.     public function getPictureThumbnail()
  746.     {
  747.         return $this->pictureThumbnail;
  748.     }
  749.     /**
  750.      * Set the value of pictureThumbnail
  751.      *
  752.      * @param  string|null  $pictureThumbnail
  753.      *
  754.      * @return  self
  755.      */ 
  756.     public function setPictureThumbnail(?string $pictureThumbnail)
  757.     {
  758.         $this->pictureThumbnail = $pictureThumbnail;
  759.         return $this;
  760.     }
  761.    /**
  762.     * Get the value of pictureImageFile
  763.     */ 
  764.    public function getPictureImageFile()
  765.    {
  766.       return $this->pictureImageFile;
  767.    }
  768.    /**
  769.     * Set the value of pictureImageFile
  770.     *
  771.     * @return  self
  772.     */ 
  773.    public function setPictureImageFile(?UploadedFile $pictureImageFile = null)
  774.    {
  775.       $this->pictureImageFile = $pictureImageFile;
  776.       if ($pictureImageFile) {
  777.         $this->setPicture($pictureImageFile);
  778.         $this->updatedAt = (new \DateTime());
  779.     }
  780.       return $this;
  781.    }
  782.    /**
  783.     * Get the value of logoThumbnail
  784.     *
  785.     * @return  string|null
  786.     */ 
  787.    public function getLogoThumbnail()
  788.    {
  789.       return $this->logoThumbnail;
  790.    }
  791.    /**
  792.     * Set the value of logoThumbnail
  793.     *
  794.     * @param  string|null  $logoThumbnail
  795.     *
  796.     * @return  self
  797.     */ 
  798.    public function setLogoThumbnail(?string $logoThumbnail)
  799.    {
  800.       $this->logoThumbnail = $logoThumbnail;
  801.       return $this;
  802.    }
  803.    /**
  804.     * Get the value of logoImageFile
  805.     *
  806.     * @return  File|null
  807.     */ 
  808.    public function getLogoImageFile()
  809.    {
  810.       return $this->logoImageFile;
  811.    }
  812.    /**
  813.     * Set the value of logoImageFile
  814.     *
  815.     * @return  self
  816.     */ 
  817.    public function setLogoImageFile(?UploadedFile $logoImageFile = null)
  818.    {
  819.       $this->logoImageFile = $logoImageFile;
  820.       if ($logoImageFile) {
  821.         $this->setLogo($logoImageFile);
  822.         $this->updatedAt = (new \DateTime());
  823.     }
  824.       return $this;
  825.    }
  826.     /**
  827.      * @param null|\DateTime $updatedAt
  828.      *
  829.      * @return JobPosition
  830.      */
  831.     public function setUpdatedAt(?\DateTime $updatedAt): self {
  832.         $this->updatedAt = $updatedAt;
  833.         return $this;
  834.     }
  835.     /**
  836.      * Specify data which should be serialized to JSON
  837.      *
  838.      * @link https://php.net/manual/en/jsonserializable.jsonserialize.php
  839.      * @return mixed data which can be serialized by <b>json_encode</b>,
  840.      * which is a value of any type other than a resource.
  841.      * @since 5.4.0
  842.      */
  843.     public function jsonSerialize() {
  844.         return [
  845.             'id' => $this->getId(),
  846.             'company' => $this->getCompany(),
  847.             'title' => $this->getTitle(),
  848.             'department' => $this->getDepartments()->getValues(),
  849.             'refNumber' => $this->getRefNumber(),
  850.             'descriptions' => $this->getDescription(),
  851.             'location' => $this->getLocation(),
  852.             'city' => $this->getCity(),
  853.             'jobType' => $this->getJobType(),
  854.             'jobTypeByLocation' => ($this->getJobSubType() && $this->getJobSubType()->getId() != self::JOB_SUB_TYPE_REGULAR) ? $this->getJobSubType() : null,
  855.             'positionLevel' => $this->getPositionLevel(),
  856.             'workingHours' => $this->getWorkingHours(),
  857.             'applyingType' => $this->getApplyingType(),
  858.             'applyingUrl' => $this->getApplyingUrl(),
  859.             'createdAt' => $this->getCreatedAt(),
  860.             'validTo' => $this->getValidTo(),
  861.             'skills' => $this->getSkills()->getValues(),
  862.             'languages' => $this->getLanguages()->getValues(),
  863.             'requiredDocuments' => $this->getRequiredDocuments()->getValues(),
  864.             'featured' => $this->getFeatured(),
  865.             'companyFeatured' => $this->getCompanyFeatured(),
  866.             'status' => $this->getStatus(),
  867.             'countApplyJobPositions' => $this->getApplicants()->count(),
  868.             'slug' => $this->getSlug(),
  869.             'promoted' => $this->getPromoted(),
  870.             'alreadyPromoted' => $this->getAlreadyPromoted(),
  871.             'totalViews' => $this->getTotalViews(),
  872.             'secondaryEmail' => $this->getSecondaryEmail(),
  873.             'salaryStart' => $this->getMinSalary(),
  874.             'salaryEnd' => $this->getMaxSalary(),
  875.             'sharePicture' => $this->getPicture(),
  876.             'additionalLogo' => $this->getLogo(),
  877.             'latitude' => $this->getLatitude(),
  878.             'longitude' => $this->getLongitude(),
  879.             'publishedAt' => $this->getPublishedAt(),
  880.         ];
  881.     }
  882. }