src/Entity/Vacancy.php line 1723

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Annotations\JobPositionMappingProperty;
  4. use App\Annotations\Seo as SEO;
  5. use App\Component\Attributes\Attribute\AttributeAware;
  6. use App\Component\Attributes\AttributeAwareInterface;
  7. use App\Component\Attributes\AttributeAwareTrait;
  8. use App\Component\ExternalIntegration\Entity\ExternalIntegrationTrait;
  9. use App\Model\Location as LocationModel;
  10. use App\Robots\Robots;
  11. use App\Robots\RobotsInterFace;
  12. use App\Util\BreadcrumbableInterface;
  13. use Doctrine\Common\Collections\ArrayCollection;
  14. use Doctrine\Common\Collections\Collection;
  15. use Doctrine\DBAL\Types\Types;
  16. use Doctrine\ORM\Mapping as ORM;
  17. use Gedmo\Mapping\Annotation as Gedmo;
  18. use Gedmo\Translatable\Translatable;
  19. use JMS\Serializer\Annotation as JMS;
  20. use JMS\Serializer\Annotation\Groups;
  21. use Money\Currency;
  22. use Money\Money;
  23. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  24. use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
  25. use Symfony\Component\Routing\RouterInterface;
  26. use Symfony\Component\Serializer\Annotation\Ignore;
  27. use Symfony\Component\Validator\Constraints as Assert;
  28. /**
  29.  * Vacancy.
  30.  *
  31.  * @ORM\Table(name="vacancy", indexes={
  32.  *     @ORM\Index(name="active", columns={"active"}),
  33.  *     @ORM\Index(name="deleted", columns={"deleted"}),
  34.  *     @ORM\Index(name="featured", columns={"featured"}),
  35.  * }, uniqueConstraints={
  36.  *     @ORM\UniqueConstraint(columns={"external_reference", "external_id"})
  37.  * })
  38.  * @ORM\Entity(repositoryClass="App\Entity\Repository\VacancyRepository")
  39.  * @Gedmo\TranslationEntity(class="App\Entity\Translation\VacancyTranslation")
  40.  * @JMS\ExclusionPolicy("all")
  41.  * @Gedmo\SoftDeleteable(fieldName="deleted", hardDelete=false)
  42.  */
  43. #[AttributeAware(attributeClassVacancyAttribute::class)]
  44. #[UniqueEntity(['externalReference''externalId'], 'External id / reference combination is already used')]
  45. class Vacancy implements SearchableBreadcrumbableInterfaceOpenGraphInterfaceAddressAwareInterfaceTaggableTranslatableSiteAwareInterfaceDomainAwareInterfaceMultiMediaInterfaceApplicationProcessAwareInterfaceAttributeAwareInterfaceRobotsInterFace
  46. {
  47.     use AddressAwareTrait;
  48.     use AttributeAwareTrait;
  49.     use CalendarTrait;
  50.     use ExternalIntegrationTrait;
  51.     use GalleryTrait;
  52.     use MetaTrait;
  53.     use OpenGraphTrait;
  54.     use SiteAwareTrait;
  55.     use UtmTrait;
  56.     public const NOTIFIED_NOT 0;
  57.     public const NOTIFIED_ON_CREATION 1;
  58.     public const NOTIFIED_HALF_TIME 2;
  59.     public const SALARY_UNITS = [
  60.         'HOUR',
  61.         'DAY',
  62.         'WEEK',
  63.         'MONTH',
  64.         'YEAR',
  65.     ];
  66.     public const VACANCY_LIFESPAN_DAYS 60;
  67.     /**
  68.      * @var int
  69.      *
  70.      * @ORM\Column(name="id", type="integer")
  71.      * @ORM\Id
  72.      * @ORM\GeneratedValue(strategy="AUTO")
  73.      * @JMS\Expose()
  74.      *
  75.      * @SEO\Meta(name="identifier")
  76.      */
  77.     private $id;
  78.     /**
  79.      * @var bool
  80.      *
  81.      * @ORM\Column(name="active", type="boolean")
  82.      *
  83.      * @deprecated Will be remove in favor for business logic in repository
  84.      */
  85.     private $active true;
  86.     /**
  87.      * @var \DateTime|null
  88.      *
  89.      * @Gedmo\Timestampable(on="create")
  90.      * @ORM\Column(type="datetime", nullable=true)
  91.      * @JMS\Expose()
  92.      * @JobPositionMappingProperty\Date
  93.      *
  94.      * @SEO\Meta
  95.      */
  96.     private $created;
  97.     /**
  98.      * @var \Datetime|null
  99.      *
  100.      * @Gedmo\Timestampable(on="update")
  101.      * @ORM\Column(type="datetime", nullable=true)
  102.      * @JMS\Expose()
  103.      * @JobPositionMappingProperty\Date
  104.      *
  105.      * @SEO\Meta
  106.      */
  107.     private $updated;
  108.     /**
  109.      * @var \DateTime|null
  110.      * @Gedmo\Timestampable(on="create")
  111.      * @ORM\Column(type="datetime", nullable=true)
  112.      * @JobPositionMappingProperty\Date
  113.      */
  114.     private $sortDate;
  115.     /**
  116.      * @var string
  117.      *
  118.      * @ORM\Column(name="contact_person", type="string", nullable=true, length=170)
  119.      * @JMS\Expose()
  120.      * @Groups({"Webservice"})
  121.      * @JobPositionMappingProperty\Text
  122.      */
  123.     #[Assert\Length(max170)]
  124.     protected $contactPerson;
  125.     /**
  126.      * @var PhoneNumber|null
  127.      * @ORM\Column(name="contact_person_phone", type="phone_number", nullable=true)
  128.      *
  129.      * @JMS\Expose()
  130.      * @JMS\Type("App\Entity\PhoneNumber")
  131.      * @Groups({"Webservice"})
  132.      *
  133.      * @JobPositionMappingProperty\Text
  134.      */
  135.     protected $contactPersonPhone;
  136.     /**
  137.      * @var string
  138.      * @Gedmo\Slug(fields={"title"}, updatable=true)
  139.      * @ORM\Column(length=170, unique=true)
  140.      * @Gedmo\Translatable
  141.      * @JMS\Expose()
  142.      * @SEO\Meta()
  143.      */
  144.     #[Assert\Length(max170)]
  145.     protected $slug;
  146.     /**
  147.      * @var string
  148.      * @ORM\Column(name="title", type="string", length=170)
  149.      * @JMS\Expose()
  150.      * @Groups({"Webservice"})
  151.      * @Gedmo\Translatable
  152.      * @SEO\Meta()
  153.      * @JobPositionMappingProperty\Text
  154.      */
  155.     #[Assert\Length(max170)]
  156.     #[Assert\NotBlank]
  157.     private $title;
  158.     /**
  159.      * @var array
  160.      *
  161.      * Non-persistent, only for view data
  162.      * Introduced to store subtitle information like searchfilters that would be removed by the VacancyDecorator
  163.      */
  164.     private array $subTitle = [];
  165.     /**
  166.      * @var string|null
  167.      * @JMS\Expose()
  168.      * @Groups({"Webservice"})
  169.      * @ORM\Column(name="company_name", type="string", nullable=true)
  170.      */
  171.     private $companyName;
  172.     /**
  173.      * @ORM\OneToOne(targetEntity="Asset", cascade={"persist"})
  174.      * @ORM\JoinColumn(name="detail_image_asset_id", nullable=true, onDelete="SET NULL")
  175.      * @JMS\Expose()
  176.      * @JobPositionMappingProperty\Image
  177.      *
  178.      * @var Asset|null
  179.      */
  180.     private $detailImage;
  181.     /**
  182.      * @ORM\OneToOne(targetEntity="App\Entity\Asset", cascade={"persist"}, fetch="EAGER")
  183.      * @ORM\JoinColumn(name="overview_image_asset_id", nullable=true, onDelete="SET NULL")
  184.      * @JMS\Expose()
  185.      * @JobPositionMappingProperty\Image
  186.      *
  187.      * @var Asset|null
  188.      */
  189.     private $overviewImage;
  190.     /**
  191.      * @ORM\OneToOne(targetEntity="Asset", cascade={"persist"})
  192.      * @ORM\JoinColumn(name="hero_image_asset_id", nullable=true, onDelete="SET NULL")
  193.      * @JMS\Expose()
  194.      * @JobPositionMappingProperty\Image
  195.      *
  196.      * @var Asset|null
  197.      */
  198.     private $heroImage;
  199.     /**
  200.      * @var string
  201.      * @ORM\Column(name="city", type="string", length=170, nullable=true)
  202.      * @JMS\Expose()
  203.      * @Groups({"Webservice"})
  204.      * @SEO\Meta()
  205.      * @JobPositionMappingProperty\Text
  206.      */
  207.     #[Assert\Length(max170)]
  208.     private $city;
  209.     /**
  210.      * @var string
  211.      * @ORM\Column(name="zipcode", type="string", length=10, nullable=true)
  212.      * @JMS\Expose()
  213.      * @Groups({"Webservice"})
  214.      * @SEO\Meta()
  215.      * @JobPositionMappingProperty\Text
  216.      */
  217.     #[Assert\Length(max10)]
  218.     private $zipcode;
  219.     /**
  220.      * @var string
  221.      * @ORM\Column(name="external_url", type="string", length=512, nullable=true)
  222.      * @JMS\Expose()
  223.      * @Groups({"Webservice"})
  224.      * @JobPositionMappingProperty\Text
  225.      */
  226.     #[Assert\Length(max255)]
  227.     #[Assert\Url]
  228.     private $externalUrl;
  229.     /**
  230.      * @var string
  231.      *
  232.      * @ORM\Column(name="intro", type="text", nullable=true)
  233.      * @JMS\Expose()
  234.      * @Groups({"Webservice"})
  235.      * @Gedmo\Translatable
  236.      * @SEO\Meta()
  237.      * @JobPositionMappingProperty\Text
  238.      */
  239.     private $intro;
  240.     /**
  241.      * @var string
  242.      *
  243.      * @JMS\SerializedName("formatted_description")
  244.      *
  245.      * @ORM\Column(name="description", type="text", nullable=true)
  246.      * @Gedmo\Translatable
  247.      * @JMS\Expose()
  248.      * @Groups({"Webservice"})
  249.      * @JobPositionMappingProperty\Text
  250.      */
  251.     private $description;
  252.     /**
  253.      * Many Vacancies have One Company.
  254.      *
  255.      * @var Company
  256.      *
  257.      * @ORM\ManyToOne(targetEntity="App\Entity\Company", inversedBy="vacancies", fetch="EAGER")
  258.      * @JMS\Expose()
  259.      * @Groups({"Webservice"})
  260.      *
  261.      * @SEO\Meta(supersededBy="companyName")
  262.      */
  263.     private $company;
  264.     /**
  265.      * One Vacancy has Many Applicants.
  266.      *
  267.      * @var Vacancy[]|ArrayCollection
  268.      *
  269.      * @ORM\OneToMany(targetEntity="App\Entity\Applicant", mappedBy="vacancy", fetch="LAZY")
  270.      */
  271.     private $applicants;
  272.     /**
  273.      * Many Vacancies have One Recruiter.
  274.      *
  275.      * @var Recruiter
  276.      *
  277.      * @ORM\ManyToOne(targetEntity="App\Entity\Recruiter", inversedBy="vacancies", fetch="EAGER", cascade={"persist"})
  278.      * @ORM\JoinColumn(name="recruiter_id", referencedColumnName="id", onDelete="SET NULL")
  279.      * @JMS\Expose()
  280.      * @Groups({"Webservice"})
  281.      */
  282.     private $recruiter;
  283.     /**
  284.      * Many Vacancies has One OptionValue.
  285.      *
  286.      * @var OptionValue
  287.      *
  288.      * @ORM\ManyToOne(targetEntity="App\Entity\OptionValue")
  289.      * @ORM\OrderBy({"position": "ASC"})
  290.      * @JMS\Expose()
  291.      */
  292.     private $mainIcon;
  293.     /**
  294.      * Many Vacancies has Many OptionValues.
  295.      *
  296.      * @var OptionValue[]|ArrayCollection
  297.      *
  298.      * @ORM\ManyToMany(targetEntity="App\Entity\OptionValue", inversedBy="vacancies")
  299.      * @ORM\JoinTable(name="vacancy_option_value_option")
  300.      * @ORM\OrderBy({"position": "ASC"})
  301.      * @JMS\Expose()
  302.      * @Groups({"Webservice"})
  303.      */
  304.     private $optionValues;
  305.     /**
  306.      * Many Vacancies have Many VacancyUspValues.
  307.      *
  308.      * @var VacancyUspValue[]|ArrayCollection
  309.      *
  310.      * @ORM\ManyToMany(targetEntity="App\Entity\VacancyUspValue", inversedBy="vacancies")
  311.      * @ORM\JoinTable(name="vacancy_usp_value_usp")
  312.      * @JMS\Expose()
  313.      */
  314.     private $vacancyUspValues;
  315.     /**
  316.      * Many Vacancies has Many USP's.
  317.      *
  318.      * @var USP[]|ArrayCollection
  319.      *
  320.      * @ORM\ManyToMany(targetEntity="App\Entity\USP", inversedBy="vacancies")
  321.      * @ORM\JoinTable(name="vacancy_usp_option")
  322.      * @JMS\Expose()
  323.      */
  324.     private $usps;
  325.     /**
  326.      * @var USP|null
  327.      * @ORM\ManyToOne(targetEntity="App\Entity\USP", cascade={"persist"})
  328.      */
  329.     private $uspSubTitle;
  330.     /**
  331.      * @var VacancyDescriptionForm|null
  332.      *
  333.      * @ORM\ManyToOne(targetEntity="App\Entity\VacancyDescriptionForm")
  334.      */
  335.     private $descriptionForm;
  336.     /**
  337.      * @var bool
  338.      * @ORM\Column(type="boolean")
  339.      * @JMS\Expose()
  340.      */
  341.     private $featured false;
  342.     /**
  343.      * @var bool
  344.      * @ORM\Column(type="boolean")
  345.      * @JMS\Expose()
  346.      */
  347.     private $internalVacancy false;
  348.     /**
  349.      * @var \DateTime|null
  350.      * @ORM\Column(type="datetime", nullable=true)
  351.      * @JMS\Expose()
  352.      * @Groups({"Webservice"})
  353.      * @JobPositionMappingProperty\Date
  354.      *
  355.      * @SEO\Meta
  356.      */
  357.     private $startDate null;
  358.     /**
  359.      * @var \DateTime|null
  360.      * @ORM\Column(type="datetime", nullable=true)
  361.      * @JMS\Expose()
  362.      * @Groups({"Webservice"})
  363.      * @JobPositionMappingProperty\Date
  364.      *
  365.      * @SEO\Meta
  366.      */
  367.     private $endDate null;
  368.     /**
  369.      * @ORM\Column(type=Types::DATETIME_MUTABLE, nullable=true)]
  370.      * @JobPositionMappingProperty\Date
  371.      * @SEO\Meta
  372.      */
  373.     #[JMS\ExposeGroups(['Webservice'])]
  374.     private ?\DateTime $jobStartDate null;
  375.     /**
  376.      * Many Vacancies have One ApplicantForm.
  377.      *
  378.      * @var ApplicantForm|null
  379.      *
  380.      * @ORM\ManyToOne(targetEntity="App\Entity\ApplicantForm")
  381.      */
  382.     private $applicantForm;
  383.     /**
  384.      * Many Vacancies have One Custom ApplicantForm.
  385.      *
  386.      * @var ApplicantForm|null
  387.      *
  388.      * @ORM\ManyToOne(targetEntity="App\Entity\ApplicantForm", cascade={"persist"})
  389.      */
  390.     private $customApplicantForm;
  391.     /**
  392.      * @var bool|null
  393.      *
  394.      * @ORM\Column(type="boolean", nullable=true)
  395.      */
  396.     private $applicantFormCustom;
  397.     /**
  398.      * @ORM\Column(type="string", length=170, nullable=true)
  399.      *
  400.      * @var string
  401.      * @JMS\Expose()
  402.      * @Groups({"Webservice"})
  403.      * @JobPositionMappingProperty\Text
  404.      */
  405.     #[Assert\Length(max170)]
  406.     private $applicantEmail;
  407.     /**
  408.      * @var \DateTime|null
  409.      *
  410.      * @ORM\Column(name="deleted", type="datetime", nullable=true)
  411.      */
  412.     private $deleted;
  413.     /**
  414.      * @var string|null
  415.      * @ORM\Column(name="external_reference", nullable=true, length=170)
  416.      * @JMS\Expose()
  417.      * @Groups({"Webservice"})
  418.      * @SEO\Meta
  419.      */
  420.     #[Assert\Length(max170)]
  421.     private $externalReference;
  422.     /**
  423.      * @var bool
  424.      *
  425.      * @ORM\Column(name="synced", type="boolean")
  426.      */
  427.     private $synced false;
  428.     /**
  429.      * @var Invoice|null
  430.      * @ORM\OneToOne(targetEntity="App\Entity\Invoice", cascade={"persist"})
  431.      */
  432.     private $invoice;
  433.     /**
  434.      * @var string|null
  435.      * @ORM\Column(name="youtube", nullable=true, length=170)
  436.      *
  437.      * @JMS\Expose()
  438.      * @Groups({"Webservice"})
  439.      * @JobPositionMappingProperty\Text
  440.      */
  441.     #[Assert\Length(max170)]
  442.     private $youtube;
  443.     /**
  444.      * @var string|null
  445.      * @ORM\Column(type="string", length=170, nullable=true)
  446.      * @JMS\Expose()
  447.      * @Groups({"Webservice"})
  448.      * @SEO\Meta
  449.      * @JobPositionMappingProperty\Text
  450.      */
  451.     #[Assert\Length(max170)]
  452.     private $externalId;
  453.     /**
  454.      * For external ATS services, the displayed id differs from the id to fetch the vacancy for
  455.      * this is the case for OTYS.
  456.      *
  457.      * @var string|null
  458.      * @ORM\Column(type="string", length=170, nullable=true, name="displayable_external_id")
  459.      * @SEO\Meta
  460.      */
  461.     #[Assert\Length(max170)]
  462.     private $displayableExternalId;
  463.     /**
  464.      * One Vacancy has Many Intermediaries.
  465.      *
  466.      * @var Vacancy[]|ArrayCollection
  467.      *
  468.      * @ORM\OneToMany(targetEntity="App\Entity\Intermediary", mappedBy="vacancy", fetch="LAZY")
  469.      */
  470.     private $intermediaries;
  471.     /**
  472.      * One Vacancy has Many VacancyQuestions.
  473.      *
  474.      * @var VacancyQuestion[]|ArrayCollection|null
  475.      *
  476.      * @ORM\OneToMany(targetEntity="VacancyQuestion", mappedBy="vacancy", cascade={"persist",
  477.      *      "remove"}, orphanRemoval=true)
  478.      */
  479.     private $vacancyQuestions;
  480.     /**
  481.      * Many Vacancies has Many Managers.
  482.      *
  483.      * @var User[]|ArrayCollection
  484.      *
  485.      * @ORM\ManyToMany(targetEntity="App\Entity\User")
  486.      * @ORM\JoinTable(name="vacancy_managers")
  487.      */
  488.     private $managers;
  489.     /**
  490.      * @var string
  491.      * @ORM\Column(name="master_vacancy", type="string", length=170, nullable=true)
  492.      * @JMS\Expose()
  493.      * @Groups({"Webservice"})
  494.      */
  495.     #[Assert\Length(max170)]
  496.     private $masterVacancyId;
  497.     /**
  498.      * @var bool
  499.      *
  500.      * @JMS\Type("bool")
  501.      * @JMS\Expose()
  502.      */
  503.     private $new false;
  504.     /**
  505.      * @var bool
  506.      */
  507.     private $canApply true;
  508.     /**
  509.      * @var Tag[]|Collection
  510.      *
  511.      * @ORM\ManyToMany(targetEntity="Tag")
  512.      * @ORM\JoinTable(name="vacancy_tags",
  513.      *     joinColumns={@ORM\JoinColumn(name="vacancy_id", referencedColumnName="id")},
  514.      *     inverseJoinColumns={@ORM\JoinColumn(name="tag_id", referencedColumnName="id")})
  515.      */
  516.     private $tags;
  517.     /**
  518.      * @var string|null
  519.      *
  520.      * @ORM\Column(type="string", nullable=true)
  521.      * @JMS\Expose()
  522.      * @Groups({"Webservice"})
  523.      * @SEO\Meta
  524.      * @JobPositionMappingProperty\Text
  525.      */
  526.     #[Assert\Length(max255)]
  527.     private $country;
  528.     /**
  529.      * @var Site[]|Collection
  530.      *
  531.      * @ORM\ManyToMany(targetEntity="Site", inversedBy="vacancies")
  532.      * @ORM\JoinTable(name="vacancy_findable_sites")
  533.      */
  534.     private $sitesToFindOn;
  535.     /**
  536.      * @var Synonym[]|Collection
  537.      *
  538.      * @ORM\ManyToMany(targetEntity="Synonym")
  539.      * @ORM\JoinTable(name="vacancy_synonyms",
  540.      *     joinColumns={@ORM\JoinColumn(name="vacancy_id", referencedColumnName="id")},
  541.      *     inverseJoinColumns={@ORM\JoinColumn(name="synonym_id", referencedColumnName="id")})
  542.      */
  543.     private $synonyms;
  544.     /**
  545.      * @var int
  546.      *
  547.      * @ORM\Column(name="salary_amount", type="integer", nullable=true)
  548.      * @JMS\Expose()
  549.      * @Groups({"Webservice"})
  550.      */
  551.     private $salaryAmount;
  552.     /**
  553.      * @var string
  554.      *
  555.      * @ORM\Column(name="salary_currency", type="string", length=64, nullable=true)
  556.      * @JMS\Expose()
  557.      * @Groups({"Webservice"})
  558.      * @JobPositionMappingProperty\Text
  559.      */
  560.     private $salaryCurrency;
  561.     /**
  562.      * @var int
  563.      *
  564.      * @ORM\Column(name="min_salary_amount", type="integer", nullable=true)
  565.      * @JMS\Expose()
  566.      * @Groups({"Webservice"})
  567.      */
  568.     #[Ignore]
  569.     private $minSalaryAmount;
  570.     /**
  571.      * @var string
  572.      *
  573.      * @ORM\Column(name="min_salary_currency", type="string", length=64, nullable=true)
  574.      * @JMS\Expose()
  575.      * @Groups({"Webservice"})
  576.      */
  577.     #[Ignore]
  578.     private $minSalaryCurrency;
  579.     /**
  580.      * @var int
  581.      *
  582.      * @ORM\Column(name="max_salary_amount", type="integer", nullable=true)
  583.      * @JMS\Expose()
  584.      * @Groups({"Webservice"})
  585.      */
  586.     #[Ignore]
  587.     private $maxSalaryAmount;
  588.     /**
  589.      * @var string
  590.      *
  591.      * @ORM\Column(name="max_salary_currency", type="string", length=64, nullable=true)
  592.      * @JMS\Expose()
  593.      * @Groups({"Webservice"})
  594.      */
  595.     #[Ignore]
  596.     private $maxSalaryCurrency;
  597.     /**
  598.      * @var string|null
  599.      *
  600.      * @JMS\Expose()
  601.      *
  602.      * @ORM\Column(type="string", nullable=true)
  603.      */
  604.     #[Assert\Length(max255)]
  605.     private $customSalary;
  606.     /**
  607.      * @var LocationModel
  608.      */
  609.     private $location;
  610.     /**
  611.      * @var int
  612.      *
  613.      * @ORM\Column(type="integer", name="redirect_count")
  614.      */
  615.     private $redirectCount 0;
  616.     /**
  617.      * @var string|null
  618.      *
  619.      * @ORM\Column(type="string", nullable=true)
  620.      * @JMS\Expose()
  621.      * @Groups({"Webservice"})
  622.      * @SEO\Meta
  623.      * @JobPositionMappingProperty\Text
  624.      */
  625.     #[Assert\Length(max255)]
  626.     private $province;
  627.     /**
  628.      * @var string|null
  629.      *
  630.      * @ORM\Column(type="text", nullable=true)
  631.      * @JMS\Expose()
  632.      * @Groups({"Webservice"})
  633.      * @JobPositionMappingProperty\Text
  634.      */
  635.     private $companyInformation;
  636.     /**
  637.      * @var VacancyTemplate|null
  638.      *
  639.      * @ORM\ManyToOne(targetEntity="VacancyTemplate", inversedBy="vacancies")
  640.      */
  641.     private $template;
  642.     /**
  643.      * @var TopJob[]|null
  644.      *
  645.      * @ORM\OneToMany(targetEntity="App\Entity\TopJob", mappedBy="vacancy")
  646.      */
  647.     private $topJobs;
  648.     /**
  649.      * Many Vacancies have Many Knockout Questions.
  650.      *
  651.      * @var KnockoutQuestion[]|ArrayCollection
  652.      *
  653.      * @ORM\ManyToMany(targetEntity="App\Entity\KnockoutQuestion", inversedBy="vacancies")
  654.      * @ORM\JoinTable(name="vacancy_knockout_questions")
  655.      * @JMS\Expose()
  656.      */
  657.     private $knockoutQuestions;
  658.     /**
  659.      * @var bool
  660.      *
  661.      * @ORM\Column(type="boolean", options={"default" : 1})
  662.      */
  663.     private $hasMoreInfoButton true;
  664.     /**
  665.      * @var Option[]|null
  666.      */
  667.     protected $groupedOptions;
  668.     /**
  669.      * @ORM\OneToOne(targetEntity="Asset", cascade={"persist"}, fetch="EAGER")
  670.      * @ORM\JoinColumn(name="company_logo_asset_id", nullable=true, onDelete="SET NULL")
  671.      * @JMS\Expose()
  672.      * @JobPositionMappingProperty\Image
  673.      *
  674.      * @var Asset|null
  675.      */
  676.     private $companyLogo;
  677.     /**
  678.      * Many Vacancies have One MultiPoster.
  679.      *
  680.      * @var MultiPoster
  681.      *
  682.      * @ORM\ManyToOne(targetEntity="App\Entity\MultiPoster", inversedBy="vacancies")
  683.      * @JMS\Expose()
  684.      */
  685.     private $multiPoster;
  686.     /**
  687.      * One Vacancy has Many CallMeBackRequests.
  688.      *
  689.      * @var CallMeBackRequest[]|ArrayCollection
  690.      *
  691.      * @ORM\OneToMany(targetEntity="App\Entity\CallMeBackRequest", mappedBy="vacancy", fetch="LAZY")
  692.      */
  693.     private $callMeBackRequests;
  694.     /**
  695.      * @var bool
  696.      *
  697.      * @ORM\Column(type="integer", name="owner_notified")
  698.      */
  699.     private $ownerNotified self::NOTIFIED_NOT;
  700.     /**
  701.      * @var string|null
  702.      *
  703.      * @ORM\Column(name="`function`",type="string", nullable=true)
  704.      * @JobPositionMappingProperty\Text
  705.      */
  706.     private $function;
  707.     /**
  708.      * @var SiteBlock[]|Collection
  709.      *
  710.      * @ORM\ManyToMany(targetEntity="App\Entity\SiteBlock")
  711.      * @ORM\JoinTable(name="vacancy_sidebar_siteblocks")
  712.      */
  713.     private $sidebarSiteBlocks;
  714.     /**
  715.      * @var OptionValue|null
  716.      *
  717.      * @ORM\ManyToOne(targetEntity="App\Entity\OptionValue")
  718.      */
  719.     private $primaryDiscipline;
  720.     /**
  721.      * @var OptionValue|null
  722.      *
  723.      * @ORM\ManyToOne(targetEntity="App\Entity\OptionValue")
  724.      */
  725.     private $secundaryDiscipline;
  726.     /**
  727.      * @ORM\ManyToOne(targetEntity="App\Entity\HarverExperience")
  728.      */
  729.     private $harverExperience;
  730.     /**
  731.      * @var string|null
  732.      * @JMS\Expose
  733.      * @JMS\SerializedName("detail_url")
  734.      * @JMS\Type("string")
  735.      */
  736.     private $detailUrl;
  737.     /**
  738.      * @ORM\Column(type="string", length=512, nullable=true)
  739.      */
  740.     private $externalDetailUrl;
  741.     /**
  742.      * @ORM\ManyToOne(targetEntity=ApplicationProcessItemCollection::class, inversedBy="vacancies")
  743.      */
  744.     private ?ApplicationProcessItemCollection $applicationProcess null;
  745.     /**
  746.      * @var VacancyDomain
  747.      *
  748.      * @ORM\ManyToOne(targetEntity=VacancyDomain::class, inversedBy="vacancies")
  749.      */
  750.     private $domain;
  751.     /**
  752.      * @ORM\Column(type="text", nullable=true)
  753.      */
  754.     private $googleForJobMapping;
  755.     /**
  756.      * @ORM\Column(type="string", length=20, nullable=true)
  757.      * @JobPositionMappingProperty\Text
  758.      */
  759.     private $salaryUnit;
  760.     /**
  761.      * @ORM\Column(type="string", nullable=true)
  762.      */
  763.     private $department;
  764.     /**
  765.      * Non-persistent array to be populated postload depending on configuration.
  766.      */
  767.     private array $overviewImages = [];
  768.     /**
  769.      * Vacancy constructor.
  770.      */
  771.     public function __construct()
  772.     {
  773.         $this->applicants = new ArrayCollection();
  774.         $this->optionValues = new ArrayCollection();
  775.         $this->usps = new ArrayCollection();
  776.         $this->vacancyQuestions = new ArrayCollection();
  777.         $this->vacancyUspValues = new ArrayCollection();
  778.         $this->managers = new ArrayCollection();
  779.         $this->tags = new ArrayCollection();
  780.         $this->sitesToFindOn = new ArrayCollection();
  781.         $this->synonyms = new ArrayCollection();
  782.         $this->topJobs = new ArrayCollection();
  783.         $this->knockoutQuestions = new ArrayCollection();
  784.         $this->sidebarSiteBlocks = new ArrayCollection();
  785.         $this->intermediaries = new ArrayCollection();
  786.         $this->callMeBackRequests = new ArrayCollection();
  787.         $this->labels = new ArrayCollection();
  788.     }
  789.     public function __clone()
  790.     {
  791.         $this->id null;
  792.         $this->slug null;
  793.         $this->applicants = new ArrayCollection();
  794.         $this->invoice null;
  795.         $this->detailImage null;
  796.         $this->heroImage null;
  797.         $this->ogImage null;
  798.         $this->overviewImage null;
  799.         $this->companyLogo null;
  800.         $this->created = new \DateTime();
  801.         $this->startDate = new \DateTime();
  802.         $this->endDate null;
  803.     }
  804.     public function getId(): ?int
  805.     {
  806.         return $this->id;
  807.     }
  808.     public function isActive(): bool
  809.     {
  810.         return $this->active;
  811.     }
  812.     public function setActive(bool $active): self
  813.     {
  814.         $this->active $active;
  815.         return $this;
  816.     }
  817.     public function getTitle(): ?string
  818.     {
  819.         return $this->title;
  820.     }
  821.     public function setTitle(string $title): self
  822.     {
  823.         $this->title $title;
  824.         return $this;
  825.     }
  826.     public function getSubTitle(): array
  827.     {
  828.         return $this->subTitle;
  829.     }
  830.     public function setSubTitle(array $subTitle): self
  831.     {
  832.         $this->subTitle $subTitle;
  833.         return $this;
  834.     }
  835.     public function getCompanyName(): ?string
  836.     {
  837.         return $this->companyName;
  838.     }
  839.     public function setCompanyName(?string $companyName): self
  840.     {
  841.         $this->companyName $companyName;
  842.         return $this;
  843.     }
  844.     public function getCompanyDisplayName(): string
  845.     {
  846.         if (!empty($this->companyName)) {
  847.             return $this->companyName;
  848.         }
  849.         if ($this->company) {
  850.             return $this->company->getName();
  851.         }
  852.         return '';
  853.     }
  854.     public function getDetailImage(): ?Asset
  855.     {
  856.         return $this->detailImage;
  857.     }
  858.     public function setDetailImage(?Asset $detailImage): self
  859.     {
  860.         $this->detailImage $detailImage;
  861.         return $this;
  862.     }
  863.     public function getOverviewImage(): ?Asset
  864.     {
  865.         return $this->overviewImage;
  866.     }
  867.     public function setOverviewImage(?Asset $overviewImage): self
  868.     {
  869.         $this->overviewImage $overviewImage;
  870.         return $this;
  871.     }
  872.     public function getHeroImage(): ?Asset
  873.     {
  874.         return $this->heroImage;
  875.     }
  876.     public function setHeroImage(?Asset $heroImage): self
  877.     {
  878.         $this->heroImage $heroImage;
  879.         return $this;
  880.     }
  881.     public function getCity(): ?string
  882.     {
  883.         return $this->city;
  884.     }
  885.     public function setCity(?string $city): self
  886.     {
  887.         $this->city $city;
  888.         return $this;
  889.     }
  890.     public function getZipcode(): ?string
  891.     {
  892.         return $this->zipcode;
  893.     }
  894.     public function setZipcode(?string $zipcode): self
  895.     {
  896.         $this->zipcode $zipcode;
  897.         return $this;
  898.     }
  899.     public function getExternalUrl(): ?string
  900.     {
  901.         return $this->externalUrl;
  902.     }
  903.     public function setExternalUrl(?string $externalUrl): self
  904.     {
  905.         $this->externalUrl $externalUrl;
  906.         return $this;
  907.     }
  908.     public function getIntro(): ?string
  909.     {
  910.         return $this->intro;
  911.     }
  912.     public function setIntro(?string $intro): self
  913.     {
  914.         $this->intro $intro;
  915.         return $this;
  916.     }
  917.     public function getDescription(): ?string
  918.     {
  919.         return $this->description;
  920.     }
  921.     public function setDescription(?string $description): self
  922.     {
  923.         $this->description $description;
  924.         return $this;
  925.     }
  926.     public function getDescriptionForm(): ?VacancyDescriptionForm
  927.     {
  928.         return $this->descriptionForm;
  929.     }
  930.     public function setDescriptionForm(?VacancyDescriptionForm $descriptionForm): self
  931.     {
  932.         $this->descriptionForm $descriptionForm;
  933.         return $this;
  934.     }
  935.     public function __toString(): string
  936.     {
  937.         return (string) $this->getTitle();
  938.     }
  939.     public function getCompany(): ?Company
  940.     {
  941.         return $this->company;
  942.     }
  943.     public function setCompany(?Company $company): self
  944.     {
  945.         $this->company $company;
  946.         return $this;
  947.     }
  948.     public function getRecruiter(): ?Recruiter
  949.     {
  950.         return $this->recruiter;
  951.     }
  952.     public function setRecruiter(?Recruiter $recruiter): self
  953.     {
  954.         $this->recruiter $recruiter;
  955.         return $this;
  956.     }
  957.     public function getSlug(): ?string
  958.     {
  959.         return $this->slug;
  960.     }
  961.     public function setSlug(string $slug): self
  962.     {
  963.         $this->slug $slug;
  964.         return $this;
  965.     }
  966.     /**
  967.      * @return Collection|Applicant[]
  968.      */
  969.     public function getApplicants(): ?Collection
  970.     {
  971.         return $this->applicants;
  972.     }
  973.     /**
  974.      * @param ArrayCollection|Vacancy[] $applicants
  975.      *
  976.      * @return Vacancy
  977.      */
  978.     public function setApplicants($applicants)
  979.     {
  980.         $this->applicants $applicants;
  981.         return $this;
  982.     }
  983.     public function getMainIcon(): ?OptionValue
  984.     {
  985.         return $this->mainIcon;
  986.     }
  987.     public function setMainIcon(?OptionValue $mainIcon): self
  988.     {
  989.         $this->mainIcon $mainIcon;
  990.         return $this;
  991.     }
  992.     /**
  993.      * @return Collection|OptionValue[]
  994.      */
  995.     public function getOptionValues(): ?Collection
  996.     {
  997.         return $this->optionValues;
  998.     }
  999.     public function addOptionValue(OptionValue $optionValue): self
  1000.     {
  1001.         if (!$this->optionValues->contains($optionValue)) {
  1002.             $this->optionValues[] = $optionValue;
  1003.         }
  1004.         return $this;
  1005.     }
  1006.     public function removeOptionValue(OptionValue $optionValue): self
  1007.     {
  1008.         if ($this->optionValues->contains($optionValue)) {
  1009.             $this->optionValues->removeElement($optionValue);
  1010.         }
  1011.         return $this;
  1012.     }
  1013.     public function removeOptionValues(): self
  1014.     {
  1015.         $this->optionValues = new ArrayCollection();
  1016.         return $this;
  1017.     }
  1018.     /**
  1019.      * @param $optionValues
  1020.      */
  1021.     public function setOptionValues($optionValues): self
  1022.     {
  1023.         $this->optionValues $optionValues;
  1024.         return $this;
  1025.     }
  1026.     /**
  1027.      * @return Collection|VacancyUspValue[]
  1028.      */
  1029.     public function getVacancyUspValues(): ?Collection
  1030.     {
  1031.         return $this->vacancyUspValues;
  1032.     }
  1033.     public function addVacancyUspValue(VacancyUspValue $vacancyUspValue): self
  1034.     {
  1035.         if (!$this->vacancyUspValues->contains($vacancyUspValue)) {
  1036.             $this->vacancyUspValues[] = $vacancyUspValue;
  1037.         }
  1038.         return $this;
  1039.     }
  1040.     public function removeVacancyUspValue(VacancyUspValue $vacancyUspValue): self
  1041.     {
  1042.         if ($this->vacancyUspValues->contains($vacancyUspValue)) {
  1043.             $this->vacancyUspValues->removeElement($vacancyUspValue);
  1044.         }
  1045.         return $this;
  1046.     }
  1047.     /**
  1048.      * @param $vacancyUspValues
  1049.      */
  1050.     public function setVacancyUspValues($vacancyUspValues): self
  1051.     {
  1052.         $this->vacancyUspValues $vacancyUspValues;
  1053.         return $this;
  1054.     }
  1055.     /**
  1056.      * @return Collection|USP[]
  1057.      */
  1058.     public function getUsps(): ?Collection
  1059.     {
  1060.         return $this->usps;
  1061.     }
  1062.     public function addUsp(USP $usp): self
  1063.     {
  1064.         if (!$this->usps->contains($usp)) {
  1065.             $this->usps[] = $usp;
  1066.         }
  1067.         return $this;
  1068.     }
  1069.     public function removeUsp(USP $usp): self
  1070.     {
  1071.         if ($this->usps->contains($usp)) {
  1072.             $this->usps->removeElement($usp);
  1073.         }
  1074.         return $this;
  1075.     }
  1076.     public function getUspSubTitle(): ?USP
  1077.     {
  1078.         return $this->uspSubTitle;
  1079.     }
  1080.     public function setUspSubTitle(?USP $uspSubTitle): self
  1081.     {
  1082.         $this->uspSubTitle $uspSubTitle;
  1083.         return $this;
  1084.     }
  1085.     public function isFeatured(): bool
  1086.     {
  1087.         return $this->featured;
  1088.     }
  1089.     public function setFeatured(bool $featured): self
  1090.     {
  1091.         $this->featured $featured;
  1092.         return $this;
  1093.     }
  1094.     public function isInternalVacancy(): bool
  1095.     {
  1096.         return $this->internalVacancy;
  1097.     }
  1098.     public function setInternalVacancy(bool $internalVacancy): self
  1099.     {
  1100.         $this->internalVacancy $internalVacancy;
  1101.         return $this;
  1102.     }
  1103.     public function getStartDate(): ?\DateTimeInterface
  1104.     {
  1105.         return $this->startDate;
  1106.     }
  1107.     public function setStartDate(?\DateTimeInterface $startDate): self
  1108.     {
  1109.         $this->startDate $startDate;
  1110.         return $this;
  1111.     }
  1112.     public function getEndDate(): ?\DateTimeInterface
  1113.     {
  1114.         return $this->endDate;
  1115.     }
  1116.     public function setEndDate(?\DateTimeInterface $endDate): self
  1117.     {
  1118.         $this->endDate $endDate;
  1119.         return $this;
  1120.     }
  1121.     public function getCreated(): ?\DateTimeInterface
  1122.     {
  1123.         return $this->created;
  1124.     }
  1125.     public function setCreated(?\DateTimeInterface $created): self
  1126.     {
  1127.         $this->created $created;
  1128.         return $this;
  1129.     }
  1130.     public function getUpdated(): ?\DateTimeInterface
  1131.     {
  1132.         return $this->updated;
  1133.     }
  1134.     public function setUpdated(?\DateTimeInterface $updated): self
  1135.     {
  1136.         $this->updated $updated;
  1137.         return $this;
  1138.     }
  1139.     public function getJobStartDate(): ?\DateTimeInterface
  1140.     {
  1141.         return $this->jobStartDate;
  1142.     }
  1143.     public function setJobStartDate(?\DateTimeInterface $jobStartDate): self
  1144.     {
  1145.         $this->jobStartDate $jobStartDate;
  1146.         return $this;
  1147.     }
  1148.     public function getApplicantForm(): ?ApplicantForm
  1149.     {
  1150.         return $this->applicantForm;
  1151.     }
  1152.     public function setApplicantForm(?ApplicantForm $applicantForm): self
  1153.     {
  1154.         $this->applicantForm $applicantForm;
  1155.         return $this;
  1156.     }
  1157.     public function getCustomApplicantForm(): ?ApplicantForm
  1158.     {
  1159.         return $this->customApplicantForm;
  1160.     }
  1161.     public function setCustomApplicantForm(?ApplicantForm $customApplicantForm): self
  1162.     {
  1163.         $this->customApplicantForm $customApplicantForm;
  1164.         return $this;
  1165.     }
  1166.     public function getApplicantEmail(): ?string
  1167.     {
  1168.         return $this->applicantEmail;
  1169.     }
  1170.     public function setApplicantEmail(?string $applicantEmail): self
  1171.     {
  1172.         $this->applicantEmail $applicantEmail;
  1173.         return $this;
  1174.     }
  1175.     public function getDeleted(): ?\DateTimeInterface
  1176.     {
  1177.         return $this->deleted;
  1178.     }
  1179.     public function setDeleted(?\DateTimeInterface $deleted): self
  1180.     {
  1181.         $this->deleted $deleted;
  1182.         return $this;
  1183.     }
  1184.     public function isSynced(): bool
  1185.     {
  1186.         return $this->synced;
  1187.     }
  1188.     public function setSynced(bool $synced): self
  1189.     {
  1190.         $this->synced $synced;
  1191.         return $this;
  1192.     }
  1193.     public function getContactPerson(): ?string
  1194.     {
  1195.         return $this->contactPerson;
  1196.     }
  1197.     public function setContactPerson(?string $contactPerson): self
  1198.     {
  1199.         $this->contactPerson $contactPerson;
  1200.         return $this;
  1201.     }
  1202.     public function getContactPersonPhone(): ?PhoneNumber
  1203.     {
  1204.         return $this->contactPersonPhone;
  1205.     }
  1206.     public function setContactPersonPhone(?PhoneNumber $contactPersonPhone): self
  1207.     {
  1208.         $this->contactPersonPhone $contactPersonPhone;
  1209.         return $this;
  1210.     }
  1211.     public function getInvoice(): ?Invoice
  1212.     {
  1213.         return $this->invoice;
  1214.     }
  1215.     public function setInvoice(?Invoice $invoice): self
  1216.     {
  1217.         $this->invoice $invoice;
  1218.         return $this;
  1219.     }
  1220.     public static function getSearchableFields(): array
  1221.     {
  1222.         return ['title''intro''description'];
  1223.     }
  1224.     public function getBreadcrumbTitle(): ?string
  1225.     {
  1226.         return (string) $this->title;
  1227.     }
  1228.     public function getYoutube(): ?string
  1229.     {
  1230.         return $this->youtube;
  1231.     }
  1232.     public function setYoutube(?string $youtube): self
  1233.     {
  1234.         $this->youtube $youtube;
  1235.         return $this;
  1236.     }
  1237.     public function getDisplayableExternalId(): ?string
  1238.     {
  1239.         return $this->displayableExternalId;
  1240.     }
  1241.     public function setDisplayableExternalId(?string $displayableExternalId): self
  1242.     {
  1243.         $this->displayableExternalId $displayableExternalId;
  1244.         return $this;
  1245.     }
  1246.     public function isDeleted(): bool
  1247.     {
  1248.         return null !== $this->deleted;
  1249.     }
  1250.     public function isPublished(): bool
  1251.     {
  1252.         $currentDateTime = new \DateTime();
  1253.         return
  1254.             $this->isActive() &&
  1255.             !$this->isDeleted() &&
  1256.             (!$this->getStartDate() || ($currentDateTime->getTimestamp() >= $this->getStartDate()->getTimeStamp())) &&
  1257.             (!$this->getEndDate() || ($currentDateTime->getTimestamp() <= $this->getEndDate()->getTimeStamp()));
  1258.     }
  1259.     /**
  1260.      * @return Collection|Tag[]
  1261.      */
  1262.     public function getTags(): Collection
  1263.     {
  1264.         return $this->tags;
  1265.     }
  1266.     public function addTag(Tag $tag): self
  1267.     {
  1268.         if (!$this->tags->contains($tag)) {
  1269.             $this->tags[] = $tag;
  1270.         }
  1271.         return $this;
  1272.     }
  1273.     public function removeTag(Tag $tag): self
  1274.     {
  1275.         if ($this->tags->contains($tag)) {
  1276.             $this->tags->removeElement($tag);
  1277.         }
  1278.         return $this;
  1279.     }
  1280.     public function removeTags(): self
  1281.     {
  1282.         $this->tags = new ArrayCollection();
  1283.         return $this;
  1284.     }
  1285.     /**
  1286.      * @return Collection|VacancyQuestion[]|null
  1287.      */
  1288.     public function getVacancyQuestions(): ?Collection
  1289.     {
  1290.         return $this->vacancyQuestions;
  1291.     }
  1292.     public function addVacancyQuestion(VacancyQuestion $vacancyQuestion): self
  1293.     {
  1294.         if (!$this->vacancyQuestions->contains($vacancyQuestion)) {
  1295.             $this->vacancyQuestions[] = $vacancyQuestion;
  1296.             $vacancyQuestion->setVacancy($this);
  1297.         }
  1298.         return $this;
  1299.     }
  1300.     public function removeVacancyQuestion(VacancyQuestion $vacancyQuestion): self
  1301.     {
  1302.         if ($this->vacancyQuestions->contains($vacancyQuestion)) {
  1303.             $this->vacancyQuestions->removeElement($vacancyQuestion);
  1304.             // set the owning side to null (unless already changed)
  1305.             if ($vacancyQuestion->getVacancy() === $this) {
  1306.                 $vacancyQuestion->setVacancy(null);
  1307.             }
  1308.         }
  1309.         return $this;
  1310.     }
  1311.     /**
  1312.      * @return Collection|User[]
  1313.      */
  1314.     public function getManagers(): ?Collection
  1315.     {
  1316.         return $this->managers;
  1317.     }
  1318.     public function addManager(User $manager): self
  1319.     {
  1320.         if (!$this->managers->contains($manager)) {
  1321.             $this->managers[] = $manager;
  1322.         }
  1323.         return $this;
  1324.     }
  1325.     public function removeManager(User $manager): self
  1326.     {
  1327.         if ($this->managers->contains($manager)) {
  1328.             $this->managers->removeElement($manager);
  1329.         }
  1330.         return $this;
  1331.     }
  1332.     /**
  1333.      * @param $managers
  1334.      */
  1335.     public function setManagers($managers): self
  1336.     {
  1337.         $this->managers $managers;
  1338.         return $this;
  1339.     }
  1340.     public function getMasterVacancyId(): ?string
  1341.     {
  1342.         return $this->masterVacancyId;
  1343.     }
  1344.     public function setMasterVacancyId(?string $masterVacancyId): self
  1345.     {
  1346.         $this->masterVacancyId $masterVacancyId;
  1347.         return $this;
  1348.     }
  1349.     public function isNew(): bool
  1350.     {
  1351.         return $this->new;
  1352.     }
  1353.     public function setNew(bool $new): self
  1354.     {
  1355.         $this->new $new;
  1356.         return $this;
  1357.     }
  1358.     public function canApply(): bool
  1359.     {
  1360.         return $this->canApply;
  1361.     }
  1362.     public function setCanApply(bool $canApply): self
  1363.     {
  1364.         $this->canApply $canApply;
  1365.         return $this;
  1366.     }
  1367.     public function getCountry(): ?string
  1368.     {
  1369.         return $this->country;
  1370.     }
  1371.     public function setCountry(?string $country): self
  1372.     {
  1373.         $this->country $country;
  1374.         return $this;
  1375.     }
  1376.     /**
  1377.      * @return Collection|Site[]
  1378.      */
  1379.     public function getSitesToFindOn(): ?Collection
  1380.     {
  1381.         return $this->sitesToFindOn;
  1382.     }
  1383.     public function addSiteToFindOn(Site $site): self
  1384.     {
  1385.         if (!$this->sitesToFindOn->contains($site)) {
  1386.             $this->sitesToFindOn->add($site);
  1387.         }
  1388.         return $this;
  1389.     }
  1390.     public function removeSiteToFindOn(Site $site): self
  1391.     {
  1392.         if ($this->sitesToFindOn->contains($site)) {
  1393.             $this->sitesToFindOn->removeElement($site);
  1394.         }
  1395.         return $this;
  1396.     }
  1397.     /**
  1398.      * @return Collection|Synonym[]
  1399.      */
  1400.     public function getSynonyms(): ?Collection
  1401.     {
  1402.         return $this->synonyms;
  1403.     }
  1404.     public function addSynonym(Synonym $synonym): self
  1405.     {
  1406.         if (!$this->synonyms->contains($synonym)) {
  1407.             $this->synonyms[] = $synonym;
  1408.         }
  1409.         return $this;
  1410.     }
  1411.     public function removeSynonym(Synonym $synonym): self
  1412.     {
  1413.         if ($this->synonyms->contains($synonym)) {
  1414.             $this->synonyms->removeElement($synonym);
  1415.         }
  1416.         return $this;
  1417.     }
  1418.     public function getLocation(): LocationModel
  1419.     {
  1420.         if (null === $this->location) {
  1421.             $this->location = new LocationModel($this->address$this->city$this->zipcode$this->country);
  1422.         }
  1423.         return $this->location;
  1424.     }
  1425.     public function getSalary(): Money
  1426.     {
  1427.         if (!$this->salaryCurrency) {
  1428.             $this->salaryCurrency 'EUR';
  1429.         }
  1430.         if (!$this->salaryAmount) {
  1431.             return new Money(0, new Currency($this->salaryCurrency));
  1432.         }
  1433.         return new Money($this->salaryAmount, new Currency($this->salaryCurrency));
  1434.     }
  1435.     public function setSalary(?Money $salary): self
  1436.     {
  1437.         $this->salaryAmount $salary?->getAmount();
  1438.         $this->salaryCurrency $salary?->getCurrency()->getCode();
  1439.         return $this;
  1440.     }
  1441.     public function getMinSalary(): Money
  1442.     {
  1443.         if (!$this->minSalaryCurrency) {
  1444.             $this->minSalaryCurrency 'EUR';
  1445.         }
  1446.         if (!$this->minSalaryAmount) {
  1447.             return new Money(0, new Currency($this->minSalaryCurrency));
  1448.         }
  1449.         return new Money($this->minSalaryAmount, new Currency($this->minSalaryCurrency));
  1450.     }
  1451.     public function setMinSalary(?Money $salary): self
  1452.     {
  1453.         $this->minSalaryAmount $salary?->getAmount();
  1454.         $this->minSalaryCurrency $salary?->getCurrency()->getCode();
  1455.         return $this;
  1456.     }
  1457.     public function getMaxSalary(): Money
  1458.     {
  1459.         if (!$this->maxSalaryCurrency) {
  1460.             $this->maxSalaryCurrency 'EUR';
  1461.         }
  1462.         if (!$this->maxSalaryAmount) {
  1463.             return new Money(0, new Currency($this->maxSalaryCurrency));
  1464.         }
  1465.         return new Money($this->maxSalaryAmount, new Currency($this->maxSalaryCurrency));
  1466.     }
  1467.     public function setMaxSalary(?Money $salary): self
  1468.     {
  1469.         $this->maxSalaryAmount $salary?->getAmount();
  1470.         $this->maxSalaryCurrency $salary?->getCurrency()->getCode();
  1471.         return $this;
  1472.     }
  1473.     public function getCustomSalary(): ?string
  1474.     {
  1475.         return $this->customSalary;
  1476.     }
  1477.     public function setCustomSalary(?string $customSalary): self
  1478.     {
  1479.         $this->customSalary $customSalary;
  1480.         return $this;
  1481.     }
  1482.     public function getSortDate(): ?\DateTimeInterface
  1483.     {
  1484.         return $this->sortDate;
  1485.     }
  1486.     public function setSortDate(?\DateTimeInterface $sortDate): self
  1487.     {
  1488.         $this->sortDate $sortDate;
  1489.         return $this;
  1490.     }
  1491.     public function getRedirectCount(): ?int
  1492.     {
  1493.         return $this->redirectCount;
  1494.     }
  1495.     public function addRedirect(): self
  1496.     {
  1497.         ++$this->redirectCount;
  1498.         return $this;
  1499.     }
  1500.     public function getProvince(): ?string
  1501.     {
  1502.         return $this->province;
  1503.     }
  1504.     public function setProvince(?string $province): self
  1505.     {
  1506.         $this->province $province;
  1507.         return $this;
  1508.     }
  1509.     public function getCompanyInformation(): ?string
  1510.     {
  1511.         return $this->companyInformation;
  1512.     }
  1513.     public function setCompanyInformation(?string $companyInformation): self
  1514.     {
  1515.         $this->companyInformation $companyInformation;
  1516.         return $this;
  1517.     }
  1518.     public function getTemplate(): ?VacancyTemplate
  1519.     {
  1520.         return $this->template;
  1521.     }
  1522.     public function setTemplate(?VacancyTemplate $template): self
  1523.     {
  1524.         $this->template $template;
  1525.         return $this;
  1526.     }
  1527.     /**
  1528.      * @return Collection|TopJob[]
  1529.      */
  1530.     public function getTopJobs(): ?Collection
  1531.     {
  1532.         return $this->topJobs;
  1533.     }
  1534.     public function addTopJob(TopJob $topJob): self
  1535.     {
  1536.         if (!$this->topJobs->contains($topJob)) {
  1537.             $this->topJobs[] = $topJob;
  1538.             $topJob->setVacancy($this);
  1539.         }
  1540.         return $this;
  1541.     }
  1542.     public function removeTopJob(TopJob $topJob): self
  1543.     {
  1544.         if ($this->topJobs->contains($topJob)) {
  1545.             $this->topJobs->removeElement($topJob);
  1546.             // set the owning side to null (unless already changed)
  1547.             if ($topJob->getVacancy() === $this) {
  1548.                 $topJob->setVacancy(null);
  1549.             }
  1550.         }
  1551.         return $this;
  1552.     }
  1553.     /**
  1554.      * @return Collection|KnockoutQuestion[]
  1555.      */
  1556.     public function getKnockoutQuestions(): ?Collection
  1557.     {
  1558.         return $this->knockoutQuestions;
  1559.     }
  1560.     /**
  1561.      * @param KnockoutQuestion[]|ArrayCollection $knockoutQuestions
  1562.      *
  1563.      * @return Vacancy
  1564.      */
  1565.     public function setKnockoutQuestions($knockoutQuestions)
  1566.     {
  1567.         $this->knockoutQuestions $knockoutQuestions;
  1568.         return $this;
  1569.     }
  1570.     public function isHasMoreInfoButton(): bool
  1571.     {
  1572.         return $this->hasMoreInfoButton;
  1573.     }
  1574.     public function setHasMoreInfoButton(bool $hasMoreInfoButton): self
  1575.     {
  1576.         $this->hasMoreInfoButton $hasMoreInfoButton;
  1577.         return $this;
  1578.     }
  1579.     /**
  1580.      * @return Option[]|null
  1581.      */
  1582.     public function getGroupedOptions(): ?array
  1583.     {
  1584.         return $this->groupedOptions;
  1585.     }
  1586.     /**
  1587.      * @param Option[]|null $groupedOptions
  1588.      */
  1589.     public function setGroupedOptions(?array $groupedOptions): self
  1590.     {
  1591.         $this->groupedOptions $groupedOptions;
  1592.         return $this;
  1593.     }
  1594.     public function getCompanyLogo(): ?Asset
  1595.     {
  1596.         if (!$this->companyLogo && $company $this->getCompany()) {
  1597.             return $company->getLogo();
  1598.         }
  1599.         return $this->companyLogo;
  1600.     }
  1601.     public function setCompanyLogo(?Asset $companyLogo): self
  1602.     {
  1603.         $this->companyLogo $companyLogo;
  1604.         return $this;
  1605.     }
  1606.     public function getMultiPoster(): ?MultiPoster
  1607.     {
  1608.         return $this->multiPoster;
  1609.     }
  1610.     public function setMultiPoster(?MultiPoster $multiPoster): self
  1611.     {
  1612.         $this->multiPoster $multiPoster;
  1613.         return $this;
  1614.     }
  1615.     public function isApplicantFormCustom(): ?bool
  1616.     {
  1617.         return $this->applicantFormCustom;
  1618.     }
  1619.     public function setApplicantFormCustom(bool $applicantFormCustom): self
  1620.     {
  1621.         $this->applicantFormCustom $applicantFormCustom;
  1622.         return $this;
  1623.     }
  1624.     /**
  1625.      * @return Collection|CallMeBackRequest[]
  1626.      */
  1627.     public function getCallMeBackRequests(): ?Collection
  1628.     {
  1629.         return $this->callMeBackRequests;
  1630.     }
  1631.     /**
  1632.      * @param CallMeBackRequest[]|ArrayCollection $callMeBackRequests
  1633.      *
  1634.      * @return Vacancy
  1635.      */
  1636.     public function setCallMeBackRequests($callMeBackRequests)
  1637.     {
  1638.         $this->callMeBackRequests $callMeBackRequests;
  1639.         return $this;
  1640.     }
  1641.     public function isOwnerNotified(): int
  1642.     {
  1643.         return $this->ownerNotified;
  1644.     }
  1645.     public function setOwnerNotified(int $ownerNotified): self
  1646.     {
  1647.         $this->ownerNotified $ownerNotified;
  1648.         return $this;
  1649.     }
  1650.     /**
  1651.      * @return array|string[]
  1652.      */
  1653.     public function getAdditionalLocationFields(): array
  1654.     {
  1655.         return [
  1656.             'zipcode',
  1657.             'city',
  1658.         ];
  1659.     }
  1660.     public function getFunction(): ?string
  1661.     {
  1662.         return $this->function;
  1663.     }
  1664.     public function setFunction(?string $function): self
  1665.     {
  1666.         $this->function $function;
  1667.         return $this;
  1668.     }
  1669.     /**
  1670.      * @return Collection|SiteBlock[]
  1671.      */
  1672.     public function getSidebarSiteBlocks(): ?Collection
  1673.     {
  1674.         return $this->sidebarSiteBlocks;
  1675.     }
  1676.     /**
  1677.      * @param SiteBlock[]|Collection $sidebarSiteBlocks
  1678.      *
  1679.      * @return Vacancy
  1680.      */
  1681.     public function setSidebarSiteBlocks($sidebarSiteBlocks)
  1682.     {
  1683.         $this->sidebarSiteBlocks $sidebarSiteBlocks;
  1684.         return $this;
  1685.     }
  1686.     public function addSidebarSiteBlock(SiteBlock $sidebarSiteBlock): self
  1687.     {
  1688.         if (!$this->sidebarSiteBlocks->contains($sidebarSiteBlock)) {
  1689.             $this->sidebarSiteBlocks[] = $sidebarSiteBlock;
  1690.         }
  1691.         return $this;
  1692.     }
  1693.     public function removeSidebarSiteBlock(SiteBlock $sidebarSiteBlock): self
  1694.     {
  1695.         if ($this->sidebarSiteBlocks->contains($sidebarSiteBlock)) {
  1696.             $this->sidebarSiteBlocks->removeElement($sidebarSiteBlock);
  1697.         }
  1698.         return $this;
  1699.     }
  1700.     public function getPrimaryDiscipline(): ?OptionValue
  1701.     {
  1702.         return $this->primaryDiscipline;
  1703.     }
  1704.     public function setPrimaryDiscipline(?OptionValue $primaryDiscipline): self
  1705.     {
  1706.         $this->primaryDiscipline $primaryDiscipline;
  1707.         return $this;
  1708.     }
  1709.     public function getSecundaryDiscipline(): ?OptionValue
  1710.     {
  1711.         return $this->secundaryDiscipline;
  1712.     }
  1713.     public function setSecundaryDiscipline(?OptionValue $secundaryDiscipline): self
  1714.     {
  1715.         $this->secundaryDiscipline $secundaryDiscipline;
  1716.         return $this;
  1717.     }
  1718.     public function getHarverExperience(): ?HarverExperience
  1719.     {
  1720.         return $this->harverExperience;
  1721.     }
  1722.     public function setHarverExperience(?HarverExperience $harverExperience): self
  1723.     {
  1724.         $this->harverExperience $harverExperience;
  1725.         return $this;
  1726.     }
  1727.     public function getActive(): ?bool
  1728.     {
  1729.         return $this->active;
  1730.     }
  1731.     public function getFeatured(): ?bool
  1732.     {
  1733.         return $this->featured;
  1734.     }
  1735.     public function getApplicantFormCustom(): ?bool
  1736.     {
  1737.         return $this->applicantFormCustom;
  1738.     }
  1739.     public function getSynced(): ?bool
  1740.     {
  1741.         return $this->synced;
  1742.     }
  1743.     public function getSalaryAmount(): ?int
  1744.     {
  1745.         return $this->salaryAmount;
  1746.     }
  1747.     public function setSalaryAmount(?int $salaryAmount): self
  1748.     {
  1749.         $this->salaryAmount $salaryAmount;
  1750.         return $this;
  1751.     }
  1752.     public function getSalaryCurrency(): ?string
  1753.     {
  1754.         return $this->salaryCurrency;
  1755.     }
  1756.     public function setSalaryCurrency(?string $salaryCurrency): self
  1757.     {
  1758.         $this->salaryCurrency $salaryCurrency;
  1759.         return $this;
  1760.     }
  1761.     public function setRedirectCount(int $redirectCount): self
  1762.     {
  1763.         $this->redirectCount $redirectCount;
  1764.         return $this;
  1765.     }
  1766.     public function getHasMoreInfoButton(): ?bool
  1767.     {
  1768.         return $this->hasMoreInfoButton;
  1769.     }
  1770.     public function getOwnerNotified(): ?int
  1771.     {
  1772.         return $this->ownerNotified;
  1773.     }
  1774.     public function addApplicant(Applicant $applicant): self
  1775.     {
  1776.         if (!$this->applicants->contains($applicant)) {
  1777.             $this->applicants[] = $applicant;
  1778.             $applicant->setVacancy($this);
  1779.         }
  1780.         return $this;
  1781.     }
  1782.     public function removeApplicant(Applicant $applicant): self
  1783.     {
  1784.         if ($this->applicants->contains($applicant)) {
  1785.             $this->applicants->removeElement($applicant);
  1786.             // set the owning side to null (unless already changed)
  1787.             if ($applicant->getVacancy() === $this) {
  1788.                 $applicant->setVacancy(null);
  1789.             }
  1790.         }
  1791.         return $this;
  1792.     }
  1793.     /**
  1794.      * @return Collection|Intermediary[]
  1795.      */
  1796.     public function getIntermediaries(): ?Collection
  1797.     {
  1798.         return $this->intermediaries;
  1799.     }
  1800.     public function addIntermediary(Intermediary $intermediary): self
  1801.     {
  1802.         if (!$this->intermediaries->contains($intermediary)) {
  1803.             $this->intermediaries[] = $intermediary;
  1804.             $intermediary->setVacancy($this);
  1805.         }
  1806.         return $this;
  1807.     }
  1808.     public function removeIntermediary(Intermediary $intermediary): self
  1809.     {
  1810.         if ($this->intermediaries->contains($intermediary)) {
  1811.             $this->intermediaries->removeElement($intermediary);
  1812.             // set the owning side to null (unless already changed)
  1813.             if ($intermediary->getVacancy() === $this) {
  1814.                 $intermediary->setVacancy(null);
  1815.             }
  1816.         }
  1817.         return $this;
  1818.     }
  1819.     public function addSitesToFindOn(Site $sitesToFindOn): self
  1820.     {
  1821.         if (!$this->sitesToFindOn->contains($sitesToFindOn)) {
  1822.             $this->sitesToFindOn[] = $sitesToFindOn;
  1823.         }
  1824.         return $this;
  1825.     }
  1826.     public function removeSitesToFindOn(Site $sitesToFindOn): self
  1827.     {
  1828.         if ($this->sitesToFindOn->contains($sitesToFindOn)) {
  1829.             $this->sitesToFindOn->removeElement($sitesToFindOn);
  1830.         }
  1831.         return $this;
  1832.     }
  1833.     public function addKnockoutQuestion(KnockoutQuestion $knockoutQuestion): self
  1834.     {
  1835.         if (!$this->knockoutQuestions->contains($knockoutQuestion)) {
  1836.             $this->knockoutQuestions[] = $knockoutQuestion;
  1837.         }
  1838.         return $this;
  1839.     }
  1840.     public function removeKnockoutQuestion(KnockoutQuestion $knockoutQuestion): self
  1841.     {
  1842.         if ($this->knockoutQuestions->contains($knockoutQuestion)) {
  1843.             $this->knockoutQuestions->removeElement($knockoutQuestion);
  1844.         }
  1845.         return $this;
  1846.     }
  1847.     public function addCallMeBackRequest(CallMeBackRequest $callMeBackRequest): self
  1848.     {
  1849.         if (!$this->callMeBackRequests->contains($callMeBackRequest)) {
  1850.             $this->callMeBackRequests[] = $callMeBackRequest;
  1851.             $callMeBackRequest->setVacancy($this);
  1852.         }
  1853.         return $this;
  1854.     }
  1855.     public function removeCallMeBackRequest(CallMeBackRequest $callMeBackRequest): self
  1856.     {
  1857.         if ($this->callMeBackRequests->contains($callMeBackRequest)) {
  1858.             $this->callMeBackRequests->removeElement($callMeBackRequest);
  1859.             // set the owning side to null (unless already changed)
  1860.             if ($callMeBackRequest->getVacancy() === $this) {
  1861.                 $callMeBackRequest->setVacancy(null);
  1862.             }
  1863.         }
  1864.         return $this;
  1865.     }
  1866.     public function getDetailUrl(): ?string
  1867.     {
  1868.         return $this->detailUrl;
  1869.     }
  1870.     public function setDetailUrl(?string $detailUrl): self
  1871.     {
  1872.         $this->detailUrl $detailUrl;
  1873.         return $this;
  1874.     }
  1875.     public function getExternalDetailUrl(): ?string
  1876.     {
  1877.         return $this->externalDetailUrl;
  1878.     }
  1879.     public function setExternalDetailUrl(?string $externalDetailUrl): self
  1880.     {
  1881.         $this->externalDetailUrl $externalDetailUrl;
  1882.         return $this;
  1883.     }
  1884.     public function getApplicationProcess(): ?ApplicationProcessItemCollection
  1885.     {
  1886.         return $this->applicationProcess;
  1887.     }
  1888.     public function setApplicationProcess(?ApplicationProcessItemCollection $applicationProcess): self
  1889.     {
  1890.         $this->applicationProcess $applicationProcess;
  1891.         return $this;
  1892.     }
  1893.     public function getDomain(): ?VacancyDomain
  1894.     {
  1895.         return $this->domain;
  1896.     }
  1897.     public function setDomain(?VacancyDomain $domain): self
  1898.     {
  1899.         $this->domain $domain;
  1900.         return $this;
  1901.     }
  1902.     public function isIndexable(): bool
  1903.     {
  1904.         if (!$this->domain) {
  1905.             return true;
  1906.         }
  1907.         return $this->domain->isIndexable();
  1908.     }
  1909.     public function getGoogleForJobMapping(): ?string
  1910.     {
  1911.         return $this->googleForJobMapping;
  1912.     }
  1913.     public function setGoogleForJobMapping(?string $googleForJobMapping): self
  1914.     {
  1915.         $this->googleForJobMapping $googleForJobMapping;
  1916.         return $this;
  1917.     }
  1918.     public function getSalaryUnit(): ?string
  1919.     {
  1920.         return $this->salaryUnit;
  1921.     }
  1922.     public function setSalaryUnit(?string $salaryUnit): self
  1923.     {
  1924.         $this->salaryUnit $salaryUnit;
  1925.         return $this;
  1926.     }
  1927.     public function getDepartment(): ?string
  1928.     {
  1929.         return $this->department;
  1930.     }
  1931.     public function setDepartment(?string $department): self
  1932.     {
  1933.         $this->department $department;
  1934.         return $this;
  1935.     }
  1936.     public function removeVacancyUspValues(): self
  1937.     {
  1938.         $this->vacancyUspValues = new ArrayCollection();
  1939.         return $this;
  1940.     }
  1941.     public function getOverviewImages(): array
  1942.     {
  1943.         return $this->overviewImages;
  1944.     }
  1945.     public function setOverviewImages(array $overviewImages): self
  1946.     {
  1947.         $this->overviewImages $overviewImages;
  1948.         return $this;
  1949.     }
  1950.     /**
  1951.      * @var string|null
  1952.      *
  1953.      * @ORM\Column(type="array", nullable=true)
  1954.      */
  1955.     private $googleCloudName = [];
  1956.     /**
  1957.      * @ORM\ManyToMany(targetEntity=Tag::class)
  1958.      * @ORM\JoinTable(name="vacancy_label")
  1959.      */
  1960.     private $labels;
  1961.     public function getGoogleCloudName(): ?array
  1962.     {
  1963.         return $this->googleCloudName;
  1964.     }
  1965.     public function setGoogleCloudName(?array $googleCloudName): self
  1966.     {
  1967.         $this->googleCloudName $googleCloudName;
  1968.         return $this;
  1969.     }
  1970.     /**
  1971.      * @return Collection|Tag[]
  1972.      */
  1973.     public function getLabels(): Collection
  1974.     {
  1975.         return $this->labels;
  1976.     }
  1977.     public function addLabel(Tag $label): self
  1978.     {
  1979.         if (!$this->labels->contains($label)) {
  1980.             $this->labels[] = $label;
  1981.         }
  1982.         return $this;
  1983.     }
  1984.     public function removeLabel(Tag $label): self
  1985.     {
  1986.         $this->labels->removeElement($label);
  1987.         return $this;
  1988.     }
  1989.     public function getRobots(): Robots
  1990.     {
  1991.         if (!$this->isActive() || $this->isDeleted() || !$this->isIndexable()) {
  1992.             return Robots::ROBOTS_NOINDEX_NOFOLLOW;
  1993.         }
  1994.         return Robots::ROBOTS_INDEX_FOLLOW;
  1995.     }
  1996.     public function softDelete(): void
  1997.     {
  1998.         $this
  1999.             ->setDeleted(new \DateTime())
  2000.             ->setExternalHash(null);
  2001.     }
  2002.     public function shouldBeSkipped(string $hash): bool
  2003.     {
  2004.         return !$this->isDeleted() && $this->externalHash === $hash;
  2005.     }
  2006.     public function getResourceUri(
  2007.         RouterInterface $router,
  2008.         int $referenceType UrlGeneratorInterface::ABSOLUTE_PATH
  2009.     ): string {
  2010.         return $router->generate(
  2011.             'vacancy_detail',
  2012.             [
  2013.                 'id' => $this->id,
  2014.                 'slug' => $this->slug,
  2015.             ],
  2016.             $referenceType
  2017.         );
  2018.     }
  2019. }