<?php
namespace App\Entity;
use App\Repository\OfferRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use App\Traits\EntityDateTimeAbleTrait;
use App\Traits\SeoTrait;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: OfferRepository::class)]
#[ORM\HasLifecycleCallbacks]
class Offer
{
const STATUS_ACTIVE = 1;
const STATUS_INACTIVE = 0;
const OFFER_TYPE_PHONE = 0;
const OFFER_TYPE_EMAIL = 1;
const OFFER_TYPE_ALL = 2;
use EntityDateTimeAbleTrait;
use SeoTrait;
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private $id;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $code = null;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $logo = null;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $companyName = null;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $website = null;
#[ORM\Column(type: 'text', nullable: true)]
private ?string $presentation = null;
#[ORM\Column(type: 'boolean', nullable: true)]
private ?bool $gender = null;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $firstName = null;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $lastName = null;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $position = null;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $email = null;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $phone = null;
#[ORM\Column(type: 'integer', nullable: true)]
private ?int $offerType = null;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $offerTitle = null;
#[ORM\ManyToOne(targetEntity: Contract::class, inversedBy: 'offers')]
private ?\App\Entity\Contract $contract = null;
#[ORM\ManyToMany(targetEntity: Expertise::class, inversedBy: 'offers')]
private Collection $expertise;
#[ORM\ManyToMany(targetEntity: Campus::class, inversedBy: 'offers')]
private Collection $campuses;
#[ORM\ManyToOne(targetEntity: StudyLevel::class, inversedBy: 'offers')]
private ?\App\Entity\StudyLevel $studyLevel = null;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $duration = null;
#[ORM\Column(type: 'text', nullable: true)]
private ?string $description = null;
#[ORM\Column(type: 'text', nullable: true)]
private ?string $expectProfile = null;
#[ORM\Column(type: 'datetime', nullable: true)]
private ?\DateTimeInterface $validDate = null;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $descriptionFile = null;
#[ORM\ManyToMany(targetEntity: Skill::class, inversedBy: 'offers')]
private Collection $skill;
#[ORM\Column(type: 'integer')]
private ?int $status = null;
#[ORM\OneToMany(targetEntity: JobCandidate::class, mappedBy: 'offer')]
private Collection $jobCandidates;
public function __construct()
{
$this->expertise = new ArrayCollection();
$this->campuses = new ArrayCollection();
$this->skill = new ArrayCollection();
$this->jobCandidates = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getCode(): ?string
{
return $this->code;
}
public function setCode(?string $code): self
{
$this->code = $code;
return $this;
}
public function getLogo(): ?string
{
return $this->logo;
}
public function setLogo(?string $logo): self
{
$this->logo = $logo;
return $this;
}
public function getCompanyName(): ?string
{
return $this->companyName;
}
public function setCompanyName(?string $companyName): self
{
$this->companyName = $companyName;
return $this;
}
public function getWebsite(): ?string
{
return $this->website;
}
public function setWebsite(?string $website): self
{
$this->website = $website;
return $this;
}
public function getPresentation(): ?string
{
return $this->presentation;
}
public function setPresentation(?string $presentation): self
{
$this->presentation = $presentation;
return $this;
}
public function getGender(): ?bool
{
return $this->gender;
}
public function setGender(?bool $gender): self
{
$this->gender = $gender;
return $this;
}
public function getFirstName(): ?string
{
return $this->firstName;
}
public function setFirstName(?string $firstName): self
{
$this->firstName = $firstName;
return $this;
}
public function getLastName(): ?string
{
return $this->lastName;
}
public function setLastName(?string $lastName): self
{
$this->lastName = $lastName;
return $this;
}
public function getPosition(): ?string
{
return $this->position;
}
public function setPosition(?string $position): self
{
$this->position = $position;
return $this;
}
public function getEmail(): ?string
{
return $this->email;
}
public function setEmail(?string $email): self
{
$this->email = $email;
return $this;
}
public function getPhone(): ?string
{
return $this->phone;
}
public function setPhone(?string $phone): self
{
$this->phone = $phone;
return $this;
}
public function getOfferType(): ?int
{
return $this->offerType;
}
public function setOfferType(?int $offerType): self
{
$this->offerType = $offerType;
return $this;
}
public function getOfferTitle(): ?string
{
return $this->offerTitle;
}
public function setOfferTitle(?string $offerTitle): self
{
$this->offerTitle = $offerTitle;
return $this;
}
public function getContract(): ?Contract
{
return $this->contract;
}
public function setContract(?Contract $contract): self
{
$this->contract = $contract;
return $this;
}
/**
* @return Collection<int, Expertise>
*/
public function getExpertise(): Collection
{
return $this->expertise;
}
public function addExpertise(Expertise $expertise): self
{
if (!$this->expertise->contains($expertise)) {
$this->expertise[] = $expertise;
}
return $this;
}
public function removeExpertise(Expertise $expertise): self
{
$this->expertise->removeElement($expertise);
return $this;
}
/**
* @return Collection|Campus[]
*/
public function getCampuses(): Collection
{
return $this->campuses;
}
public function addCampus(Campus $campus): self
{
if (!$this->campuses->contains($campus)) {
$this->campuses[] = $campus;
}
return $this;
}
public function removeCampus(Campus $campus): self
{
$this->campuses->removeElement($campus);
return $this;
}
public function getStudyLevel(): ?StudyLevel
{
return $this->studyLevel;
}
public function setStudyLevel(?StudyLevel $studyLevel): self
{
$this->studyLevel = $studyLevel;
return $this;
}
public function getDuration(): ?string
{
return $this->duration;
}
public function setDuration(?string $duration): self
{
$this->duration = $duration;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}
public function getExpectProfile(): ?string
{
return $this->expectProfile;
}
public function setExpectProfile(?string $expectProfile): self
{
$this->expectProfile = $expectProfile;
return $this;
}
public function getValidDate(): ?\DateTimeInterface
{
return $this->validDate;
}
public function setValidDate(?\DateTimeInterface $validDate): self
{
$this->validDate = $validDate;
return $this;
}
public function getDescriptionFile(): ?string
{
return $this->descriptionFile;
}
public function setDescriptionFile(?string $descriptionFile): self
{
$this->descriptionFile = $descriptionFile;
return $this;
}
/**
* @return Collection<int, Skill>
*/
public function getSkill(): Collection
{
return $this->skill;
}
public function addSkill(Skill $skill): self
{
if (!$this->skill->contains($skill)) {
$this->skill[] = $skill;
}
return $this;
}
public function removeSkill(Skill $skill): self
{
$this->skill->removeElement($skill);
return $this;
}
public function getStatus(): ?int
{
return $this->status;
}
public function setStatus(int $status): self
{
$this->status = $status;
return $this;
}
/**
* @return Collection<int, JobCandidate>
*/
public function getJobCandidates(): Collection
{
return $this->jobCandidates;
}
public function addJobCandidate(JobCandidate $jobCandidate): self
{
if (!$this->jobCandidates->contains($jobCandidate)) {
$this->jobCandidates[] = $jobCandidate;
$jobCandidate->setOffer($this);
}
return $this;
}
public function removeJobCandidate(JobCandidate $jobCandidate): self
{
if ($this->jobCandidates->removeElement($jobCandidate)) {
// set the owning side to null (unless already changed)
if ($jobCandidate->getOffer() === $this) {
$jobCandidate->setOffer(null);
}
}
return $this;
}
}