src/Entity/Applicant.php line 32

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Annotations\Xss\XssAware;
  4. use App\Annotations\Xss\XssProperty;
  5. use App\Component\GDPR\Annotation as GDPR;
  6. use App\Component\GDPR\Entity\AnonymizedTrait;
  7. use App\Validator as SerenaAssert;
  8. use DateTime;
  9. use Doctrine\Common\Collections\ArrayCollection;
  10. use Doctrine\Common\Collections\Collection;
  11. use Doctrine\ORM\Mapping as ORM;
  12. use Gedmo\Mapping\Annotation as Gedmo;
  13. use JMS\Serializer\Annotation as JMS;
  14. use Symfony\Component\HttpFoundation\File\File;
  15. use Symfony\Component\HttpFoundation\File\UploadedFile;
  16. use Symfony\Component\Validator\Constraints as Assert;
  17. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  18. /**
  19.  * Vacancy.
  20.  *
  21.  * @ORM\Table(name="applicant")
  22.  * @ORM\Entity(repositoryClass="App\Entity\Repository\ApplicantRepository")
  23.  * @Vich\Uploadable
  24.  * @JMS\ExclusionPolicy("all")
  25.  * @Gedmo\SoftDeleteable(fieldName="deletedAt")
  26.  * @XssAware
  27.  * @SerenaAssert\UniqueApplication()
  28.  */
  29. class Applicant
  30. {
  31.     use AnonymizedTrait;
  32.     /**
  33.      * @var int
  34.      *
  35.      * @ORM\Column(name="id", type="integer")
  36.      * @ORM\Id
  37.      * @ORM\GeneratedValue(strategy="AUTO")
  38.      * @JMS\Expose()
  39.      */
  40.     private $id;
  41.     /**
  42.      * Many Applicants have One Vacancy.
  43.      *
  44.      * @var Vacancy
  45.      *
  46.      * @ORM\ManyToOne(targetEntity="Vacancy", inversedBy="applicants", fetch="EAGER")
  47.      */
  48.     private $vacancy;
  49.     /**
  50.      * @var string
  51.      *
  52.      * @ORM\Column(name="first_name", type="string", length=170, nullable=true)
  53.      * @JMS\Expose()
  54.      * @JMS\SerializedName("firstname")
  55.      * @GDPR\Anonymize(type="fixed", value="anonymized")
  56.      * @XssProperty
  57.      */
  58.     private $firstName;
  59.     /**
  60.      * @var string|null
  61.      *
  62.      * @ORM\Column(name="insertion", type="string", nullable=true)
  63.      * @GDPR\Anonymize(type="null")
  64.      * @XssProperty
  65.      */
  66.     private $insertion;
  67.     /**
  68.      * @var string
  69.      *
  70.      * @ORM\Column(name="last_name", type="string", length=170, nullable=true)
  71.      * @JMS\Expose()
  72.      * @JMS\SerializedName("lastname")
  73.      * @GDPR\Anonymize(type="fixed", value="anonymized")
  74.      * @XssProperty
  75.      */
  76.     private $lastName;
  77.     /**
  78.      * @var string|null
  79.      *
  80.      * @ORM\Column(name="city", type="string", length=170, nullable=true)
  81.      * @JMS\Expose()
  82.      * @GDPR\Anonymize(type="fixed", value="anonymized")
  83.      * @XssProperty
  84.      */
  85.     private $city;
  86.     /**
  87.      * @var PhoneNumber|null
  88.      * @ORM\Column(name="phone", type="phone_number", nullable=true)
  89.      *
  90.      * @JMS\Expose()
  91.      * @JMS\Type("App\Entity\PhoneNumber")
  92.      *
  93.      * @GDPR\Anonymize(type="null")
  94.      */
  95.     private $phone;
  96.     /**
  97.      * @var PhoneNumber|null
  98.      * @ORM\Column(name="intl_phone", type="phone_number", nullable=true)
  99.      *
  100.      * @JMS\SerializedName("intlphone")
  101.      * @JMS\Type("App\Entity\PhoneNumber")
  102.      *
  103.      * @GDPR\Anonymize(type="null")
  104.      */
  105.     private $intlPhone;
  106.     /**
  107.      * @var string
  108.      *
  109.      * @ORM\Column(name="email", type="string", length=170, nullable=true)
  110.      * @JMS\Expose()
  111.      * @GDPR\Anonymize(type="hash")
  112.      */
  113.     #[Assert\Email]
  114.     private $email;
  115.     /**
  116.      * @ORM\Column(type="datetime")
  117.      *
  118.      * @var \DateTime
  119.      */
  120.     private $createdAt;
  121.     /**
  122.      * @Vich\UploadableField(mapping="applicant_upload", fileNameProperty="fileName", size="fileSize")
  123.      *
  124.      * @var File
  125.      * @GDPR\Anonymize(type="null")
  126.      */
  127.     private $CVFile;
  128.     /**
  129.      * @Vich\UploadableField(mapping="applicant_upload", fileNameProperty="fileNameMotivation", size="fileSizeMotivation")
  130.      *
  131.      * @var File
  132.      * @GDPR\Anonymize(type="null")
  133.      */
  134.     private $motivationFile;
  135.     /**
  136.      * @ORM\Column(type="string", length=170, nullable=true)
  137.      *
  138.      * @var string
  139.      * @GDPR\Anonymize(type="null")
  140.      */
  141.     private $fileName;
  142.     /**
  143.      * @ORM\Column(type="integer", nullable=true)
  144.      *
  145.      * @var int
  146.      */
  147.     private $fileSize;
  148.     /**
  149.      * @ORM\Column(type="string", length=170, nullable=true)
  150.      *
  151.      * @var string
  152.      * @GDPR\Anonymize(type="null")
  153.      */
  154.     private $fileNameMotivation;
  155.     /**
  156.      * @ORM\Column(type="integer", nullable=true)
  157.      *
  158.      * @var int
  159.      */
  160.     private $fileSizeMotivation;
  161.     /**
  162.      * @var string
  163.      *
  164.      * @ORM\Column(name="motivation", type="text", nullable=true)
  165.      * @JMS\Expose()
  166.      * @GDPR\Anonymize(type="fixed", value="anonymized")
  167.      * @XssProperty
  168.      */
  169.     private $motivation;
  170.     /**
  171.      * Many applicants have one Status.
  172.      *
  173.      * @var Status
  174.      *
  175.      * @ORM\ManyToOne(targetEntity="App\Entity\Status")
  176.      */
  177.     private $status;
  178.     /**
  179.      * @var string
  180.      *
  181.      * @ORM\Column(name="description", type="text", nullable=true)
  182.      * @XssProperty
  183.      */
  184.     private $description;
  185.     /**
  186.      * One Applicant has Many Notes.
  187.      *
  188.      * @var Note[]|ArrayCollection
  189.      *
  190.      * @ORM\OneToMany(targetEntity="Note", mappedBy="applicant", cascade={"persist",
  191.      *      "remove"}, orphanRemoval=true)
  192.      * @ORM\OrderBy({"createdAt": "DESC"})
  193.      */
  194.     private $notes;
  195.     /**
  196.      * @var string This is saved as json
  197.      *
  198.      * @ORM\Column(type="text", nullable=true)
  199.      * @GDPR\Anonymize(type="null")
  200.      */
  201.     private $data;
  202.     /**
  203.      * @var string
  204.      *
  205.      * @ORM\Column(type="text", nullable=true)
  206.      */
  207.     private $questionAnswerData;
  208.     /**
  209.      * @var bool
  210.      *
  211.      * @ORM\Column(type="boolean", name="privacy_policy")
  212.      */
  213.     private $acceptedPrivacyPolicy false;
  214.     /**
  215.      * @var bool
  216.      *
  217.      * @ORM\Column(type="boolean", name="applicant_send_to_applicant_mail")
  218.      */
  219.     private $applicantSendToApplicantMail false;
  220.     /**
  221.      * @var string
  222.      *
  223.      * @ORM\Column(type="string", name="linkedin_profile_url", nullable=true)
  224.      * @XssProperty
  225.      */
  226.     private $linkedinProfileUrl;
  227.     /**
  228.      * @var DateTime
  229.      *
  230.      * @ORM\Column(name="deleted_at", type="datetime", nullable=true)
  231.      */
  232.     private $deletedAt;
  233.     /**
  234.      * @var bool
  235.      *
  236.      * @ORM\Column(type="boolean", name="clone")
  237.      */
  238.     private $clone false;
  239.     /**
  240.      * @var bool
  241.      *
  242.      * @ORM\Column(type="boolean", name="manual")
  243.      */
  244.     private $manual false;
  245.     /**
  246.      * Many Triggers have One Mail.
  247.      *
  248.      * @var Mail|null
  249.      *
  250.      * @ORM\ManyToOne(targetEntity="Mail")
  251.      */
  252.     private $manualMail;
  253.     /**
  254.      * @ORM\Column(type="datetime", name="sent_at", nullable=true)
  255.      *
  256.      * @var DateTime
  257.      */
  258.     private $sentAt;
  259.     /**
  260.      * @var string|null
  261.      *
  262.      * @ORM\Column(type="string", name="external_id", nullable=true)
  263.      */
  264.     private $externalId;
  265.     /**
  266.      * @var string|null
  267.      *
  268.      * External ID for the Candidate object
  269.      *
  270.      * @ORM\Column(type="string", nullable=true)
  271.      */
  272.     private $externalCandidateId;
  273.     /**
  274.      * @var DateTime
  275.      *
  276.      * @ORM\Column(type="datetime", nullable=true)
  277.      * @Gedmo\Timestampable(on="update")
  278.      */
  279.     private $updatedAt;
  280.     /**
  281.      * @var array
  282.      *
  283.      * @ORM\Column(type="array", nullable=true)
  284.      */
  285.     private $utm;
  286.     /**
  287.      * @var string
  288.      *
  289.      * @ORM\Column(name="knockout_question_answers", type="json", nullable=true)
  290.      */
  291.     private $knockoutQuestionAnswers;
  292.     /**
  293.      * @var bool
  294.      *
  295.      * @ORM\Column(type="boolean", name="rejected_by_knockout")
  296.      */
  297.     private $rejectedByKnockout false;
  298.     /**
  299.      * @ORM\ManyToOne(targetEntity="App\Entity\GdprStatement")
  300.      *
  301.      * @var GdprStatement
  302.      */
  303.     private $gdpr;
  304.     /**
  305.      * @ORM\Column(type="string", length=255, nullable=true)
  306.      */
  307.     private $locale;
  308.     /**
  309.      * @ORM\Column(type="string", length=255, nullable=true)
  310.      */
  311.     private $externalResumeId;
  312.     /**
  313.      * URL from where the applicant has applied.
  314.      *
  315.      * @ORM\Column(type="string", length=255, nullable=true)
  316.      */
  317.     private ?string $applyUrl null;
  318.     /**
  319.      * @ORM\ManyToOne(targetEntity="App\Entity\Company")
  320.      */
  321.     private ?Company $company null;
  322.     /** @ORM\ManyToOne(targetEntity="App\Entity\ApplicantForm", inversedBy="applicants") */
  323.     private ?ApplicantForm $applicantForm null;
  324.     public function __construct()
  325.     {
  326.         $this->utm = [];
  327.         if (null === $this->getCreatedAt()) {
  328.             $this->setCreatedAt(new \DateTime('now'));
  329.         }
  330.         $this->notes = new ArrayCollection();
  331.     }
  332.     public function getFirstName(): ?string
  333.     {
  334.         return $this->firstName;
  335.     }
  336.     public function setFirstName(?string $firstName): self
  337.     {
  338.         $this->firstName $firstName;
  339.         return $this;
  340.     }
  341.     public function getInsertion(): ?string
  342.     {
  343.         return $this->insertion;
  344.     }
  345.     public function setInsertion(?string $insertion): self
  346.     {
  347.         $this->insertion $insertion;
  348.         return $this;
  349.     }
  350.     public function getLastName(): ?string
  351.     {
  352.         return $this->lastName;
  353.     }
  354.     public function setLastName(?string $lastName): self
  355.     {
  356.         $this->lastName $lastName;
  357.         return $this;
  358.     }
  359.     public function getFullName(): string
  360.     {
  361.         $arguments = [
  362.             $this->firstName,
  363.             $this->insertion,
  364.             $this->lastName,
  365.         ];
  366.         return implode(' 'array_filter($arguments));
  367.     }
  368.     public function getCity(): ?string
  369.     {
  370.         return $this->city;
  371.     }
  372.     public function setCity(?string $city): self
  373.     {
  374.         $this->city $city;
  375.         return $this;
  376.     }
  377.     public function getCreatedAt(): ?\DateTimeInterface
  378.     {
  379.         return $this->createdAt;
  380.     }
  381.     public function setCreatedAt(\DateTimeInterface $createdAt): self
  382.     {
  383.         $this->createdAt $createdAt;
  384.         return $this;
  385.     }
  386.     /**
  387.      * If manually uploading a file (i.e. not using Symfony Form) ensure an instance
  388.      * of 'UploadedFile' is injected into this setter to trigger the  update. If this
  389.      * bundle's configuration parameter 'inject_on_load' is set to 'true' this setter
  390.      * must be able to accept an instance of 'File' as the bundle will inject one here
  391.      * during Doctrine hydration.
  392.      *
  393.      * @param File|UploadedFile $cv
  394.      */
  395.     public function setCVFile(File $cv null): self
  396.     {
  397.         $this->CVFile $cv;
  398.         if (null !== $cv) {
  399.             $this->updatedAt = new \DateTimeImmutable();
  400.         }
  401.         return $this;
  402.     }
  403.     /**
  404.      * @return File
  405.      */
  406.     public function getCVFile()
  407.     {
  408.         return $this->CVFile;
  409.     }
  410.     /**
  411.      * If manually uploading a file (i.e. not using Symfony Form) ensure an instance
  412.      * of 'UploadedFile' is injected into this setter to trigger the  update. If this
  413.      * bundle's configuration parameter 'inject_on_load' is set to 'true' this setter
  414.      * must be able to accept an instance of 'File' as the bundle will inject one here
  415.      * during Doctrine hydration.
  416.      *
  417.      * @param File|UploadedFile $cv
  418.      */
  419.     public function setMotivationFile(File $motivationFile null): self
  420.     {
  421.         $this->motivationFile $motivationFile;
  422.         if (null !== $motivationFile) {
  423.             $this->updatedAt = new \DateTimeImmutable();
  424.         }
  425.         return $this;
  426.     }
  427.     /**
  428.      * @return File
  429.      */
  430.     public function getMotivationFile(): ?File
  431.     {
  432.         return $this->motivationFile;
  433.     }
  434.     public function setFileName(?string $fileName): self
  435.     {
  436.         $this->fileName $fileName;
  437.         return $this;
  438.     }
  439.     public function getFileName(): ?string
  440.     {
  441.         return $this->fileName;
  442.     }
  443.     public function setFileSize(?int $fileSize): self
  444.     {
  445.         $this->fileSize $fileSize;
  446.         return $this;
  447.     }
  448.     public function getFileSize(): ?int
  449.     {
  450.         return $this->fileSize;
  451.     }
  452.     public function setFileNameMotivation(?string $fileNameMotivation): self
  453.     {
  454.         $this->fileNameMotivation $fileNameMotivation;
  455.         return $this;
  456.     }
  457.     public function getFileNameMotivation(): ?string
  458.     {
  459.         return $this->fileNameMotivation;
  460.     }
  461.     public function setFileSizeMotivation(?int $fileSizeMotivation): self
  462.     {
  463.         $this->fileSizeMotivation $fileSizeMotivation;
  464.         return $this;
  465.     }
  466.     public function getFileSizeMotivation(): ?int
  467.     {
  468.         return $this->fileSizeMotivation;
  469.     }
  470.     public function getId(): ?int
  471.     {
  472.         return $this->id;
  473.     }
  474.     public function getMotivation(): ?string
  475.     {
  476.         return $this->motivation;
  477.     }
  478.     public function setMotivation(?string $motivation): self
  479.     {
  480.         $this->motivation $motivation;
  481.         return $this;
  482.     }
  483.     public function getStatus(): ?Status
  484.     {
  485.         return $this->status;
  486.     }
  487.     public function setStatus(?Status $status): self
  488.     {
  489.         $this->status $status;
  490.         return $this;
  491.     }
  492.     public function getDescription(): ?string
  493.     {
  494.         return $this->description;
  495.     }
  496.     public function setDescription(?string $description): self
  497.     {
  498.         $this->description $description;
  499.         return $this;
  500.     }
  501.     public function getEmail(): ?string
  502.     {
  503.         return $this->email;
  504.     }
  505.     public function setEmail(?string $email): self
  506.     {
  507.         $this->email null !== $email mb_strtolower($email) : null;
  508.         return $this;
  509.     }
  510.     public function getVacancy(): ?Vacancy
  511.     {
  512.         return $this->vacancy;
  513.     }
  514.     public function setVacancy(?Vacancy $vacancy): self
  515.     {
  516.         $this->vacancy $vacancy;
  517.         return $this;
  518.     }
  519.     public function getPhone(): ?PhoneNumber
  520.     {
  521.         return $this->phone;
  522.     }
  523.     public function setPhone(?PhoneNumber $phone): self
  524.     {
  525.         $this->phone $phone;
  526.         return $this;
  527.     }
  528.     public function getIntlPhone(): ?PhoneNumber
  529.     {
  530.         return $this->intlPhone;
  531.     }
  532.     public function setIntlPhone(?PhoneNumber $intlPhone): self
  533.     {
  534.         $this->intlPhone $intlPhone;
  535.         return $this;
  536.     }
  537.     public function getData(): ?string
  538.     {
  539.         return $this->data;
  540.     }
  541.     /**
  542.      * Get the applicant data as array instead of JSON.
  543.      */
  544.     public function getDataArray(): ?array
  545.     {
  546.         return json_decode($this->datatrue);
  547.     }
  548.     public function setData(?string $data): self
  549.     {
  550.         $this->data $data;
  551.         return $this;
  552.     }
  553.     public function getQuestionAnswerData(): ?string
  554.     {
  555.         return $this->questionAnswerData;
  556.     }
  557.     public function setQuestionAnswerData(?string $questionAnswerData): self
  558.     {
  559.         $this->questionAnswerData $questionAnswerData;
  560.         return $this;
  561.     }
  562.     /**
  563.      * @return Collection|Note[]
  564.      */
  565.     public function getNotes(): Collection
  566.     {
  567.         return $this->notes;
  568.     }
  569.     public function addNote(Note $note): self
  570.     {
  571.         if (!$this->notes->contains($note)) {
  572.             $this->notes[] = $note;
  573.             $note->setApplicant($this);
  574.         }
  575.         return $this;
  576.     }
  577.     /**
  578.      * @return $this
  579.      */
  580.     public function removeValue(Note $note)
  581.     {
  582.         $this->notes->removeElement($note);
  583.         return $this;
  584.     }
  585.     public function hasAcceptedPrivacyPolicy(): bool
  586.     {
  587.         return $this->acceptedPrivacyPolicy;
  588.     }
  589.     public function setAcceptedPrivacyPolicy(bool $acceptedPrivacyPolicy): self
  590.     {
  591.         $this->acceptedPrivacyPolicy $acceptedPrivacyPolicy;
  592.         return $this;
  593.     }
  594.     public function isApplicantSendToApplicantMail(): bool
  595.     {
  596.         return $this->applicantSendToApplicantMail;
  597.     }
  598.     public function setApplicantSendToApplicantMail(bool $applicantSendToApplicantMail): self
  599.     {
  600.         $this->applicantSendToApplicantMail $applicantSendToApplicantMail;
  601.         return $this;
  602.     }
  603.     public function getLinkedinProfileUrl(): ?string
  604.     {
  605.         return $this->linkedinProfileUrl;
  606.     }
  607.     public function setLinkedinProfileUrl(?string $linkedinProfileUrl): self
  608.     {
  609.         $this->linkedinProfileUrl $linkedinProfileUrl;
  610.         return $this;
  611.     }
  612.     public function getDeletedAt(): ?\DateTimeInterface
  613.     {
  614.         return $this->deletedAt;
  615.     }
  616.     public function setDeletedAt(?\DateTimeInterface $deletedAt): self
  617.     {
  618.         $this->deletedAt $deletedAt;
  619.         return $this;
  620.     }
  621.     public function isClone(): bool
  622.     {
  623.         return $this->clone;
  624.     }
  625.     public function setClone(bool $clone): self
  626.     {
  627.         $this->clone $clone;
  628.         return $this;
  629.     }
  630.     public function isManual(): bool
  631.     {
  632.         return $this->manual;
  633.     }
  634.     public function setManual(bool $manual): self
  635.     {
  636.         $this->manual $manual;
  637.         return $this;
  638.     }
  639.     public function getManualMail(): ?Mail
  640.     {
  641.         return $this->manualMail;
  642.     }
  643.     public function setManualMail(?Mail $manualMail): self
  644.     {
  645.         $this->manualMail $manualMail;
  646.         return $this;
  647.     }
  648.     public function getSentAt(): ?\DateTimeInterface
  649.     {
  650.         return $this->sentAt;
  651.     }
  652.     public function setSentAt(?\DateTimeInterface $sentAt): self
  653.     {
  654.         $this->sentAt $sentAt;
  655.         return $this;
  656.     }
  657.     public function getExternalId(): ?string
  658.     {
  659.         return $this->externalId;
  660.     }
  661.     public function setExternalId(?string $externalId): self
  662.     {
  663.         $this->externalId $externalId;
  664.         return $this;
  665.     }
  666.     public function getExternalCandidateId(): ?string
  667.     {
  668.         return $this->externalCandidateId;
  669.     }
  670.     public function setExternalCandidateId(?string $externalCandidateId): self
  671.     {
  672.         $this->externalCandidateId $externalCandidateId;
  673.         return $this;
  674.     }
  675.     public function hasExternalIds(): bool
  676.     {
  677.         return \is_string($this->getExternalId()) && \is_string($this->getExternalCandidateId());
  678.     }
  679.     public function getUtm(): ?array
  680.     {
  681.         return $this->utm;
  682.     }
  683.     public function setUtm(?array $utm): self
  684.     {
  685.         $this->utm $utm;
  686.         return $this;
  687.     }
  688.     public function getKnockoutQuestionAnswers(): ?array
  689.     {
  690.         return $this->knockoutQuestionAnswers;
  691.     }
  692.     public function setKnockoutQuestionAnswers(?array $knockoutQuestionAnswers): self
  693.     {
  694.         $this->knockoutQuestionAnswers $knockoutQuestionAnswers;
  695.         return $this;
  696.     }
  697.     public function isRejectedByKnockout(): bool
  698.     {
  699.         return $this->rejectedByKnockout;
  700.     }
  701.     public function setRejectedByKnockout(bool $rejectedByKnockout): self
  702.     {
  703.         $this->rejectedByKnockout $rejectedByKnockout;
  704.         return $this;
  705.     }
  706.     public function getGdpr(): ?GdprStatement
  707.     {
  708.         return $this->gdpr;
  709.     }
  710.     public function setGdpr(?GdprStatement $gdpr): self
  711.     {
  712.         $this->gdpr $gdpr;
  713.         return $this;
  714.     }
  715.     public function getAcceptedPrivacyPolicy(): ?bool
  716.     {
  717.         return $this->acceptedPrivacyPolicy;
  718.     }
  719.     public function getApplicantSendToApplicantMail(): ?bool
  720.     {
  721.         return $this->applicantSendToApplicantMail;
  722.     }
  723.     public function getClone(): ?bool
  724.     {
  725.         return $this->clone;
  726.     }
  727.     public function getManual(): ?bool
  728.     {
  729.         return $this->manual;
  730.     }
  731.     public function getUpdatedAt(): ?\DateTimeInterface
  732.     {
  733.         return $this->updatedAt;
  734.     }
  735.     public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
  736.     {
  737.         $this->updatedAt $updatedAt;
  738.         return $this;
  739.     }
  740.     public function getRejectedByKnockout(): ?bool
  741.     {
  742.         return $this->rejectedByKnockout;
  743.     }
  744.     public function removeNote(Note $note): self
  745.     {
  746.         if ($this->notes->contains($note)) {
  747.             $this->notes->removeElement($note);
  748.             // set the owning side to null (unless already changed)
  749.             if ($note->getApplicant() === $this) {
  750.                 $note->setApplicant(null);
  751.             }
  752.         }
  753.         return $this;
  754.     }
  755.     public function getExternalResumeId(): ?string
  756.     {
  757.         return $this->externalResumeId;
  758.     }
  759.     public function setExternalResumeId(?string $externalResumeId): self
  760.     {
  761.         $this->externalResumeId $externalResumeId;
  762.         return $this;
  763.     }
  764.     public function getLocale(): ?string
  765.     {
  766.         return $this->locale;
  767.     }
  768.     public function setLocale(?string $locale): self
  769.     {
  770.         $this->locale $locale;
  771.         return $this;
  772.     }
  773.     public function getApplyUrl(): ?string
  774.     {
  775.         return $this->applyUrl;
  776.     }
  777.     public function setApplyUrl(?string $applyUrl): self
  778.     {
  779.         $this->applyUrl $applyUrl;
  780.         return $this;
  781.     }
  782.     public function isOpenApplication(): bool
  783.     {
  784.         return !$this->getVacancy() instanceof Vacancy;
  785.     }
  786.     public function addCVFile(?string $cvFileName, ?string $pathPrefix): void
  787.     {
  788.         if (null === $cvFileName) {
  789.             return;
  790.         }
  791.         if (null === $pathPrefix) {
  792.             return;
  793.         }
  794.         $this->setCVFile(new UploadedFile(
  795.             sprintf('%s%s'$pathPrefix$cvFileName),
  796.             $cvFileName
  797.         ));
  798.     }
  799.     public function getCompany(): ?Company
  800.     {
  801.         return $this->company;
  802.     }
  803.     public function setCompany(?Company $company): self
  804.     {
  805.         $this->company $company;
  806.         return $this;
  807.     }
  808.     public function getApplicantForm(): ?ApplicantForm
  809.     {
  810.         return $this->applicantForm;
  811.     }
  812.     public function setApplicantForm(?ApplicantForm $applicantForm): self
  813.     {
  814.         $this->applicantForm $applicantForm;
  815.         return $this;
  816.     }
  817.     public function getExternalVacancyReference(): ?string
  818.     {
  819.         if ($this->getVacancy() instanceof Vacancy) {
  820.             return $this->getVacancy()->getExternalReference();
  821.         }
  822.         if (\is_string($this->getApplicantForm()?->getExternalReference())) {
  823.             return $this->getApplicantForm()->getExternalReference();
  824.         }
  825.         return null;
  826.     }
  827.     public function getExternalVacancyId(): ?string
  828.     {
  829.         if ($this->getVacancy() instanceof Vacancy) {
  830.             return $this->getVacancy()->getExternalId();
  831.         }
  832.         if (\is_string($this->getApplicantForm()?->getExternalVacancyId())) {
  833.             return $this->getApplicantForm()->getExternalVacancyId();
  834.         }
  835.         return null;
  836.     }
  837. }