<?php
namespace App\Entity;
use App\Repository\JobRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Symfony\Component\Serializer\Annotation\Groups;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: 'App\Repository\JobRepository')]
class Job
{
#[Groups(['LogService', 'APIJob'])]
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private $id;
#[Groups(['LogService', 'APIJob'])]
#[ORM\Column(type: 'string', length: 255)]
private $title;
#[Groups(['LogService', 'APIJob'])]
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $level;
#[Groups(['LogService', 'APIJob'])]
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $employmentType;
#[Groups(['LogService', 'APIJob'])]
#[ORM\Column(type: 'text', nullable: true)]
private $scope;
#[Groups(['LogService', 'APIJob'])]
#[ORM\Column(type: 'text', nullable: true)]
private $requirement;
#[Groups(['LogService', 'APIJob'])]
#[ORM\Column(type: 'datetime')]
private $createdAt;
#[Groups(['LogService', 'APIJob'])]
#[ORM\Column(type: 'datetime', nullable: true)]
private $modifiedAt;
#[Groups(['LogService'])]
#[ORM\Column(type: 'datetime', nullable: true)]
private $endAt;
#[Groups(['LogService'])]
#[ORM\ManyToOne(targetEntity: User::class, inversedBy: 'jobs')]
#[ORM\JoinColumn(nullable: false)]
private $createdBy;
#[Groups(['LogService'])]
#[ORM\ManyToOne(targetEntity: User::class)]
private $modifiedBy;
#[Groups(['APIJob'])]
#[ORM\ManyToOne(targetEntity: Department::class, inversedBy: 'jobs')]
private $department;
#[ORM\ManyToOne(targetEntity: Company::class, inversedBy: 'jobs')]
#[ORM\JoinColumn(nullable: false)]
private $company;
#[Groups(['APIJob'])]
#[ORM\Column(type: 'boolean', nullable: true)]
private $isHidden = false;
#[ORM\ManyToMany(targetEntity: Office::class, inversedBy: 'jobs')]
private $office;
public function __construct()
{
$this->office = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getTitle(): ?string
{
return $this->title;
}
public function setTitle(string $title): self
{
$this->title = $title;
return $this;
}
public function getLevel(): ?string
{
return $this->level;
}
public function setLevel(?string $level): self
{
$this->level = $level;
return $this;
}
public function getEmploymentType(): ?string
{
return $this->employmentType;
}
public function setEmploymentType(?string $employmentType): self
{
$this->employmentType = $employmentType;
return $this;
}
public function getScope(): ?string
{
return $this->scope;
}
public function setScope(?string $scope): self
{
$this->scope = $scope;
return $this;
}
public function getRequirement(): ?string
{
return $this->requirement;
}
public function setRequirement(?string $requirement): self
{
$this->requirement = $requirement;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
public function setCreatedAt(\DateTimeInterface $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
public function getModifiedAt(): ?\DateTimeInterface
{
return $this->modifiedAt;
}
public function setModifiedAt(?\DateTimeInterface $modifiedAt): self
{
$this->modifiedAt = $modifiedAt;
return $this;
}
public function getEndAt(): ?\DateTimeInterface
{
return $this->endAt;
}
public function setEndAt(?\DateTimeInterface $endAt): self
{
$this->endAt = $endAt;
return $this;
}
public function getCreatedBy(): ?User
{
return $this->createdBy;
}
public function setCreatedBy(?User $createdBy): self
{
$this->createdBy = $createdBy;
return $this;
}
public function getModifiedBy(): ?User
{
return $this->modifiedBy;
}
public function setModifiedBy(?User $modifiedBy): self
{
$this->modifiedBy = $modifiedBy;
return $this;
}
public function getDepartment(): ?Department
{
return $this->department;
}
public function setDepartment(?Department $department): self
{
$this->department = $department;
return $this;
}
public function getCompany(): ?Company
{
return $this->company;
}
public function setCompany(?Company $company): self
{
$this->company = $company;
return $this;
}
public function getIsHidden(): ?bool
{
return $this->isHidden;
}
public function setIsHidden(?bool $isHidden): self
{
$this->isHidden = $isHidden;
return $this;
}
/**
* @return Collection|Office[]
*/
public function getOffice(): Collection
{
return $this->office;
}
public function addOffice(Office $office): self
{
if (!$this->office->contains($office)) {
$this->office[] = $office;
}
return $this;
}
public function removeOffice(Office $office): self
{
$this->office->removeElement($office);
return $this;
}
}