src/AtechNet/CoreBundle/Entity/Job.php line 18

Open in your IDE?
  1. <?php
  2. namespace App\AtechNet\CoreBundle\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Doctrine\ORM\Mapping\Column;
  5. use Doctrine\ORM\Mapping\Entity;
  6. use Doctrine\ORM\Mapping\JoinColumn;
  7. use Doctrine\ORM\Mapping\ManyToOne;
  8. use Doctrine\ORM\Mapping\Table as Table;
  9. /**
  10.  * Job
  11.  *
  12.  * @Table(name="jobs")
  13.  * @Entity()
  14.  */
  15. class Job extends AbstractSignedEntity
  16. {
  17.     public const TYPE_FULL_TIME = 1;
  18.     public const TYPE_PART_TIME = 2;
  19.     public const TYPE_BRIGADE = 3;
  20.     public const TYPE_TRAINEE = 4;
  21.     public const TYPE_SUBCONTRACTOR = 5;
  22.     public const ENTRY_TYPE_ASAP = 1;
  23.     public const ENTRY_TYPE_BY_AGREEMENT = 2;
  24.     public const ID_BASIC_JOB = 43;
  25.     public const ID_BASIC_BRIGAD = 44;
  26.     public const ID_BASIC_INTERNSHIP = 45;
  27.     public static function getBasicJobIds():array
  28.     {
  29.         return [
  30.             self::ID_BASIC_JOB,
  31.             self::ID_BASIC_BRIGAD,
  32.             self::ID_BASIC_INTERNSHIP,
  33.         ];
  34.     }
  35.     public static function getTypeChoices(): array
  36.     {
  37.         return [
  38.             self::TYPE_FULL_TIME     => 'Full time',
  39.             self::TYPE_PART_TIME     => 'Part time',
  40.             self::TYPE_BRIGADE       => 'Brigade',
  41.             self::TYPE_TRAINEE       => 'Trainee',
  42.             self::TYPE_SUBCONTRACTOR => 'Sub contractor',
  43.         ];
  44.     }
  45.     public static function getEntryTypeChoices(): array
  46.     {
  47.         return [
  48.             self::ENTRY_TYPE_ASAP         => 'Immediate entry',
  49.             self::ENTRY_TYPE_BY_AGREEMENT => 'By agreement',
  50.         ];
  51.     }
  52.     /**
  53.      * @var Language
  54.      *
  55.      * @ManyToOne(targetEntity="Language")
  56.      * @JoinColumn(name="language_id", referencedColumnName="id", nullable=true)
  57.      */
  58.     private $language;
  59.     /**
  60.      * @var string
  61.      *
  62.      * @Column(name="title", type="string", length=256)
  63.      */
  64.     private $title;
  65.     /**
  66.      * @var int
  67.      *
  68.      * @Column(name="type", type="integer")
  69.      */
  70.     private $type = 0;
  71.     /**
  72.      * @var string
  73.      *
  74.      * @Column(name="short_description", type="text")
  75.      */
  76.     private $shortDescription;
  77.     /**
  78.      * @var string
  79.      *
  80.      * @Column(name="requirements", type="text")
  81.      */
  82.     private $requirements;
  83.     /**
  84.      * @var string
  85.      *
  86.      * @Column(name="offer", type="text")
  87.      */
  88.     private $offer;
  89.     /**
  90.      * @var string
  91.      *
  92.      * @Column(name="signupLink", type="string", length=512)
  93.      */
  94.     private $signupLink;
  95.     /**
  96.      * @var bool
  97.      *
  98.      * @Column(name="published", type="boolean")
  99.      */
  100.     private $published = false;
  101.     /**
  102.      * @var bool
  103.      *
  104.      * @Column(name="available", type="boolean")
  105.      */
  106.     private $available = false;
  107.     /**
  108.      * @var string
  109.      *
  110.      * @Column(name="cover_image_title", type="text", nullable=true)
  111.      */
  112.     private $coverImageTitle;
  113.     /**
  114.      * @var string
  115.      *
  116.      * @Column(name="minimum_wage", type="string", length=24, nullable=true)
  117.      */
  118.     private $minimumWage;
  119.     /**
  120.      * @var string
  121.      *
  122.      * @Column(name="maximum_wage", type="string", length=24, nullable=true)
  123.      */
  124.     private $maximumWage;
  125.     /**
  126.      * @var string
  127.      *
  128.      * @Column(name="wage_description", type="text", nullable=true)
  129.      */
  130.     private $wageDescription;
  131.     /**
  132.      * @var \DateTime
  133.      *
  134.      * @Column(name="available_until", type="datetime", nullable=true)
  135.      */
  136.     private $availableUntil;
  137.     /**
  138.      * @var \DateTime
  139.      *
  140.      * @Column(name="work_start", type="datetime", nullable=true)
  141.      */
  142.     private $workStart;
  143.     /**
  144.      * @var int
  145.      *
  146.      * @Column(name="entry_type", type="integer")
  147.      */
  148.     private int $entryType = 1;
  149.     /**
  150.      * @var int
  151.      *
  152.      * @Column(name="sort_order", type="integer")
  153.      */
  154.     private int $sortOrder = 0;
  155.     /**
  156.      * @return Language|null
  157.      */
  158.     public function getLanguage(): ?Language
  159.     {
  160.         return $this->language;
  161.     }
  162.     /**
  163.      * @param Language|null $language
  164.      */
  165.     public function setLanguage(?Language $language)
  166.     {
  167.         $this->language = $language;
  168.     }
  169.     /**
  170.      * @return string
  171.      */
  172.     public function getTitle()
  173.     {
  174.         return $this->title;
  175.     }
  176.     /**
  177.      * @param string $title
  178.      */
  179.     public function setTitle($title)
  180.     {
  181.         $this->title = $title;
  182.     }
  183.     /**
  184.      * @return string
  185.      */
  186.     public function getShortDescription()
  187.     {
  188.         return $this->shortDescription;
  189.     }
  190.     /**
  191.      * @param string $shortDescription
  192.      */
  193.     public function setShortDescription($shortDescription)
  194.     {
  195.         $this->shortDescription = $shortDescription;
  196.     }
  197.     /**
  198.      * @return string
  199.      */
  200.     public function getSignupLink()
  201.     {
  202.         return $this->signupLink;
  203.     }
  204.     /**
  205.      * @param string $signupLink
  206.      */
  207.     public function setSignupLink($signupLink)
  208.     {
  209.         $this->signupLink = $signupLink;
  210.     }
  211.     /**
  212.      * @return bool
  213.      */
  214.     public function isPublished()
  215.     {
  216.         return $this->published;
  217.     }
  218.     /**
  219.      * @param bool $published
  220.      */
  221.     public function setPublished($published)
  222.     {
  223.         $this->published = $published;
  224.     }
  225.     /**
  226.      * @return bool
  227.      */
  228.     public function isAvailable()
  229.     {
  230.         return $this->available;
  231.     }
  232.     /**
  233.      * @param bool $available
  234.      */
  235.     public function setAvailable($available)
  236.     {
  237.         $this->available = $available;
  238.     }
  239.     /**
  240.      * @return int
  241.      */
  242.     public function getType()
  243.     {
  244.         return $this->type;
  245.     }
  246.     /**
  247.      * @param int $type
  248.      */
  249.     public function setType($type)
  250.     {
  251.         $this->type = $type;
  252.     }
  253.     /**
  254.      * @return string
  255.      */
  256.     public function getRequirements()
  257.     {
  258.         return $this->requirements;
  259.     }
  260.     /**
  261.      * @param string $requirements
  262.      */
  263.     public function setRequirements($requirements)
  264.     {
  265.         $this->requirements = $requirements;
  266.     }
  267.     /**
  268.      * @return string
  269.      */
  270.     public function getOffer()
  271.     {
  272.         return $this->offer;
  273.     }
  274.     /**
  275.      * @param string $offer
  276.      */
  277.     public function setOffer($offer)
  278.     {
  279.         $this->offer = $offer;
  280.     }
  281.     /**
  282.      * @return string
  283.      */
  284.     public function getCoverImageTitle()
  285.     {
  286.         return $this->coverImageTitle;
  287.     }
  288.     /**
  289.      * @param string $coverImageTitle
  290.      */
  291.     public function setCoverImageTitle($coverImageTitle)
  292.     {
  293.         $this->coverImageTitle = $coverImageTitle;
  294.     }
  295.     /**
  296.      * @return string
  297.      */
  298.     public function getMinimumWage()
  299.     {
  300.         return $this->minimumWage;
  301.     }
  302.     /**
  303.      * @param string $minimumWage
  304.      */
  305.     public function setMinimumWage($minimumWage)
  306.     {
  307.         $this->minimumWage = $minimumWage;
  308.     }
  309.     /**
  310.      * @return string
  311.      */
  312.     public function getMaximumWage()
  313.     {
  314.         return $this->maximumWage;
  315.     }
  316.     /**
  317.      * @param string $maximumWage
  318.      */
  319.     public function setMaximumWage($maximumWage)
  320.     {
  321.         $this->maximumWage = $maximumWage;
  322.     }
  323.     /**
  324.      * @return \DateTime
  325.      */
  326.     public function getAvailableUntil()
  327.     {
  328.         return $this->availableUntil;
  329.     }
  330.     /**
  331.      * @param \DateTime $availableUntil
  332.      */
  333.     public function setAvailableUntil($availableUntil)
  334.     {
  335.         $this->availableUntil = $availableUntil;
  336.     }
  337.     /**
  338.      * @return bool
  339.      */
  340.     public function isActive()
  341.     {
  342.         return $this->isAvailable() && (is_null($this->getAvailableUntil()) || $this->getAvailableUntil() <= new \DateTime());
  343.     }
  344.     /**
  345.      * @return \DateTime
  346.      */
  347.     public function getWorkStart()
  348.     {
  349.         return $this->workStart;
  350.     }
  351.     /**
  352.      * @param \DateTime $workStart
  353.      */
  354.     public function setWorkStart($workStart)
  355.     {
  356.         $this->workStart = $workStart;
  357.     }
  358.     /**
  359.      * @return string|null
  360.      */
  361.     public function getWageDescription(): ?string
  362.     {
  363.         return $this->wageDescription;
  364.     }
  365.     /**
  366.      * @param string|null $wageDescription
  367.      */
  368.     public function setWageDescription(?string $wageDescription): void
  369.     {
  370.         $this->wageDescription = $wageDescription;
  371.     }
  372.     /**
  373.      * @return int
  374.      */
  375.     public function getEntryType(): int
  376.     {
  377.         return $this->entryType;
  378.     }
  379.     /**
  380.      * @param int $entryType
  381.      *
  382.      * @return void
  383.      */
  384.     public function setEntryType(int $entryType): void
  385.     {
  386.         $this->entryType = $entryType;
  387.     }
  388.     /**
  389.      * @return int
  390.      */
  391.     public function getSortOrder(): int
  392.     {
  393.         return $this->sortOrder;
  394.     }
  395.     /**
  396.      * @param int $sortOrder
  397.      *
  398.      * @return void
  399.      */
  400.     public function setSortOrder(int $sortOrder): void
  401.     {
  402.         $this->sortOrder = $sortOrder;
  403.     }
  404. }