src/Entity/Job.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\JobRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Symfony\Component\Serializer\Annotation\Groups;
  7. use Doctrine\ORM\Mapping as ORM;
  8. #[ORM\Entity(repositoryClass'App\Repository\JobRepository')]
  9. class Job
  10. {
  11.     #[Groups(['LogService''APIJob'])]
  12.     #[ORM\Id]
  13.     #[ORM\GeneratedValue]
  14.     #[ORM\Column(type'integer')]
  15.     private $id;
  16.     #[Groups(['LogService''APIJob'])]
  17.     #[ORM\Column(type'string'length255)]
  18.     private $title;
  19.     #[Groups(['LogService''APIJob'])]
  20.     #[ORM\Column(type'string'length255nullabletrue)]
  21.     private $level;
  22.     #[Groups(['LogService''APIJob'])]
  23.     #[ORM\Column(type'string'length255nullabletrue)]
  24.     private $employmentType;
  25.     #[Groups(['LogService''APIJob'])]
  26.     #[ORM\Column(type'text'nullabletrue)]
  27.     private $scope;
  28.     #[Groups(['LogService''APIJob'])]
  29.     #[ORM\Column(type'text'nullabletrue)]
  30.     private $requirement;
  31.     #[Groups(['LogService''APIJob'])]
  32.     #[ORM\Column(type'datetime')]
  33.     private $createdAt;
  34.     #[Groups(['LogService''APIJob'])]
  35.     #[ORM\Column(type'datetime'nullabletrue)]
  36.     private $modifiedAt;
  37.     #[Groups(['LogService'])]
  38.     #[ORM\Column(type'datetime'nullabletrue)]
  39.     private $endAt;
  40.     #[Groups(['LogService'])]
  41.     #[ORM\ManyToOne(targetEntityUser::class, inversedBy'jobs')]
  42.     #[ORM\JoinColumn(nullablefalse)]
  43.     private $createdBy;
  44.     #[Groups(['LogService'])]
  45.     #[ORM\ManyToOne(targetEntityUser::class)]
  46.     private $modifiedBy;
  47.         #[Groups(['APIJob'])]
  48.     #[ORM\ManyToOne(targetEntityDepartment::class, inversedBy'jobs')]
  49.     private $department;
  50.     #[ORM\ManyToOne(targetEntityCompany::class, inversedBy'jobs')]
  51.     #[ORM\JoinColumn(nullablefalse)]
  52.     private $company;
  53.      #[Groups(['APIJob'])]
  54.     #[ORM\Column(type'boolean'nullabletrue)]
  55.     private $isHidden false;
  56.     #[ORM\ManyToMany(targetEntityOffice::class, inversedBy'jobs')]
  57.     private $office;
  58.     public function __construct()
  59.     {
  60.         $this->office = new ArrayCollection();
  61.     }
  62.     public function getId(): ?int
  63.     {
  64.         return $this->id;
  65.     }
  66.     public function getTitle(): ?string
  67.     {
  68.         return $this->title;
  69.     }
  70.     public function setTitle(string $title): self
  71.     {
  72.         $this->title $title;
  73.         return $this;
  74.     }
  75.     public function getLevel(): ?string
  76.     {
  77.         return $this->level;
  78.     }
  79.     public function setLevel(?string $level): self
  80.     {
  81.         $this->level $level;
  82.         return $this;
  83.     }
  84.     public function getEmploymentType(): ?string
  85.     {
  86.         return $this->employmentType;
  87.     }
  88.     public function setEmploymentType(?string $employmentType): self
  89.     {
  90.         $this->employmentType $employmentType;
  91.         return $this;
  92.     }
  93.     public function getScope(): ?string
  94.     {
  95.         return $this->scope;
  96.     }
  97.     public function setScope(?string $scope): self
  98.     {
  99.         $this->scope $scope;
  100.         return $this;
  101.     }
  102.     public function getRequirement(): ?string
  103.     {
  104.         return $this->requirement;
  105.     }
  106.     public function setRequirement(?string $requirement): self
  107.     {
  108.         $this->requirement $requirement;
  109.         return $this;
  110.     }
  111.     public function getCreatedAt(): ?\DateTimeInterface
  112.     {
  113.         return $this->createdAt;
  114.     }
  115.     public function setCreatedAt(\DateTimeInterface $createdAt): self
  116.     {
  117.         $this->createdAt $createdAt;
  118.         return $this;
  119.     }
  120.     public function getModifiedAt(): ?\DateTimeInterface
  121.     {
  122.         return $this->modifiedAt;
  123.     }
  124.     public function setModifiedAt(?\DateTimeInterface $modifiedAt): self
  125.     {
  126.         $this->modifiedAt $modifiedAt;
  127.         return $this;
  128.     }
  129.     public function getEndAt(): ?\DateTimeInterface
  130.     {
  131.         return $this->endAt;
  132.     }
  133.     public function setEndAt(?\DateTimeInterface $endAt): self
  134.     {
  135.         $this->endAt $endAt;
  136.         return $this;
  137.     }
  138.     public function getCreatedBy(): ?User
  139.     {
  140.         return $this->createdBy;
  141.     }
  142.     public function setCreatedBy(?User $createdBy): self
  143.     {
  144.         $this->createdBy $createdBy;
  145.         return $this;
  146.     }
  147.     public function getModifiedBy(): ?User
  148.     {
  149.         return $this->modifiedBy;
  150.     }
  151.     public function setModifiedBy(?User $modifiedBy): self
  152.     {
  153.         $this->modifiedBy $modifiedBy;
  154.         return $this;
  155.     }
  156.     public function getDepartment(): ?Department
  157.     {
  158.         return $this->department;
  159.     }
  160.     public function setDepartment(?Department $department): self
  161.     {
  162.         $this->department $department;
  163.         return $this;
  164.     }
  165.     public function getCompany(): ?Company
  166.     {
  167.         return $this->company;
  168.     }
  169.     public function setCompany(?Company $company): self
  170.     {
  171.         $this->company $company;
  172.         return $this;
  173.     }
  174.     public function getIsHidden(): ?bool
  175.     {
  176.         return $this->isHidden;
  177.     }
  178.     public function setIsHidden(?bool $isHidden): self
  179.     {
  180.         $this->isHidden $isHidden;
  181.         return $this;
  182.     }
  183.     /**
  184.      * @return Collection|Office[]
  185.      */
  186.     public function getOffice(): Collection
  187.     {
  188.         return $this->office;
  189.     }
  190.     public function addOffice(Office $office): self
  191.     {
  192.         if (!$this->office->contains($office)) {
  193.             $this->office[] = $office;
  194.         }
  195.         return $this;
  196.     }
  197.     public function removeOffice(Office $office): self
  198.     {
  199.         $this->office->removeElement($office);
  200.         return $this;
  201.     }
  202. }