<?php
namespace App\Entity;
use ApiPlatform\Core\Annotation\ApiResource;
use App\Controller\Admin\AdminController;
use App\Controller\Admin\OfferController;
use Symfony\Component\Serializer\Annotation\Groups;
use App\Repository\OfferRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: OfferRepository::class)]
#[ApiResource(
description: 'GET collection of offers from interfor',
itemOperations: [
'get' => [
'normalization_context' => ['groups' => ['show:list']],
'denormalization_context' => ['groups' => ['show:list']],
],
],
)]
class Offer
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 510, nullable: true)]
#[Groups(['show:list'])]
private ?string $job_title = null;
#[ORM\Column(type: Types::TEXT, nullable: true)]
#[Groups(['show:list'])]
private ?string $job_description = null;
#[ORM\ManyToMany(targetEntity: Training::class, inversedBy: 'offers')]
private Collection $training;
#[ORM\Column(nullable: true)]
#[Groups(['show:list'])]
private ?bool $state = null;
#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
#[Groups(['show:list'])]
private ?\DateTimeInterface $date = null;
#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
#[Groups(['show:list'])]
private ?\DateTimeInterface $start_date = null;
#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
private ?\DateTimeInterface $cv_book_relaunch_date = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $contact = null;
#[ORM\Column(nullable: true)]
private ?bool $isArchived = false;
#[ORM\Column(length: 255)]
private ?string $company_siret = null;
#[ORM\Column(length: 255)]
private ?string $company_name = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $company_address = null;
#[ORM\Column(length: 255, nullable: true)]
#[Groups(['show:list'])]
private ?string $company_city = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $company_zipcode = null;
#[ORM\Column(length: 255)]
private ?string $company_email = null;
#[ORM\Column(length: 255)]
private ?string $company_phone = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $idcc = null;
#[ORM\OneToMany(mappedBy: 'offer', targetEntity: Application::class)]
private Collection $applications;
#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
private ?\DateTimeInterface $follow_up_step_date = null;
#[ORM\ManyToOne(inversedBy: 'offers')]
private ?FollowUpOfferStep $followUpOfferStep = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $opco = null;
#[ORM\OneToMany(mappedBy: 'offer', targetEntity: BookCv::class)]
private Collection $bookCvs;
#[ORM\OneToMany(mappedBy: 'offer', targetEntity: OfferComment::class)]
private Collection $comments;
#[ORM\OneToMany(mappedBy: 'offer', targetEntity: HistoryOffers::class)]
private Collection $historyOffers;
#[ORM\Column(nullable: true)]
private ?bool $company = null;
public function __construct()
{
$this->training = new ArrayCollection();
$this->applications = new ArrayCollection();
$this->bookCvs = new ArrayCollection();
$this->comments = new ArrayCollection();
$this->historyOffers = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getJobTitle(): ?string
{
return $this->job_title;
}
public function setJobTitle(?string $job_title): self
{
$this->job_title = $job_title;
return $this;
}
public function getJobDescription(): ?string
{
return $this->job_description;
}
public function setJobDescription(?string $job_description): self
{
$this->job_description = $job_description;
return $this;
}
/**
* @return Collection<int, Training>
*/
public function getTraining(): Collection
{
return $this->training;
}
public function addTraining(Training $training): self
{
if (!$this->training->contains($training)) {
$this->training->add($training);
}
return $this;
}
public function removeTraining(Training $training): self
{
$this->training->removeElement($training);
return $this;
}
public function isState(): ?bool
{
return $this->state;
}
public function setState(?bool $state): self
{
$this->state = $state;
return $this;
}
public function getDate(): ?\DateTimeInterface
{
return $this->date;
}
public function setDate(?\DateTimeInterface $date): self
{
$this->date = $date;
return $this;
}
public function getStartDate(): ?\DateTimeInterface
{
return $this->start_date;
}
public function setStartDate(?\DateTimeInterface $start_date): self
{
$this->start_date = $start_date;
return $this;
}
public function getCvBookRelaunchDate(): ?\DateTimeInterface
{
return $this->cv_book_relaunch_date;
}
public function setCvBookRelaunchDate(?\DateTimeInterface $cv_book_relaunch_date): self
{
$this->cv_book_relaunch_date = $cv_book_relaunch_date;
return $this;
}
public function getContact(): ?string
{
return $this->contact;
}
public function setContact(?string $contact): self
{
$this->contact = $contact;
return $this;
}
public function isIsArchived(): ?bool
{
return $this->isArchived;
}
public function setIsArchived(?bool $isArchived): self
{
$this->isArchived = $isArchived;
return $this;
}
public function getCompanySiret(): ?string
{
return $this->company_siret;
}
public function setCompanySiret(string $company_siret): self
{
$this->company_siret = $company_siret;
return $this;
}
public function getCompanyName(): ?string
{
return $this->company_name;
}
public function setCompanyName(string $company_name): self
{
$this->company_name = $company_name;
return $this;
}
public function getCompanyAddress(): ?string
{
return $this->company_address;
}
public function setCompanyAddress(?string $company_address): self
{
$this->company_address = $company_address;
return $this;
}
public function getCompanyCity(): ?string
{
return $this->company_city;
}
public function setCompanyCity(?string $company_city): self
{
$this->company_city = $company_city;
return $this;
}
public function getCompanyZipcode(): ?string
{
return $this->company_zipcode;
}
public function setCompanyZipcode(?string $company_zipcode): self
{
$this->company_zipcode = $company_zipcode;
return $this;
}
public function getCompanyEmail(): ?string
{
return $this->company_email;
}
public function setCompanyEmail(string $company_email): self
{
$this->company_email = $company_email;
return $this;
}
public function getCompanyPhone(): ?string
{
return $this->company_phone;
}
public function setCompanyPhone(string $company_phone): self
{
$this->company_phone = $company_phone;
return $this;
}
public function getIdcc(): ?string
{
return $this->idcc;
}
public function setIdcc(?string $idcc): self
{
$this->idcc = $idcc;
return $this;
}
/**
* @return Collection<int, Application>
*/
public function getApplications(): Collection
{
return $this->applications;
}
public function addApplication(Application $application): self
{
if (!$this->applications->contains($application)) {
$this->applications->add($application);
$application->setOffer($this);
}
return $this;
}
public function removeApplication(Application $application): self
{
if ($this->applications->removeElement($application)) {
// set the owning side to null (unless already changed)
if ($application->getOffer() === $this) {
$application->setOffer(null);
}
}
return $this;
}
public function getFollowUpStepDate(): ?\DateTimeInterface
{
return $this->follow_up_step_date;
}
public function setFollowUpStepDate(?\DateTimeInterface $follow_up_step_date): self
{
$this->follow_up_step_date = $follow_up_step_date;
return $this;
}
public function getFollowUpOfferStep(): ?FollowUpOfferStep
{
return $this->followUpOfferStep;
}
public function setFollowUpOfferStep(?FollowUpOfferStep $followUpOfferStep): self
{
$this->followUpOfferStep = $followUpOfferStep;
return $this;
}
public function getOpco(): ?string
{
return $this->opco;
}
public function setOpco(?string $opco): self
{
$this->opco = $opco;
return $this;
}
/**
* @return Collection<int, BookCv>
*/
public function getBookCvs(): Collection
{
return $this->bookCvs;
}
public function addBookCv(BookCv $bookCv): self
{
if (!$this->bookCvs->contains($bookCv)) {
$this->bookCvs->add($bookCv);
$bookCv->setOffer($this);
}
return $this;
}
public function removeBookCv(BookCv $bookCv): self
{
if ($this->bookCvs->removeElement($bookCv)) {
// set the owning side to null (unless already changed)
if ($bookCv->getOffer() === $this) {
$bookCv->setOffer(null);
}
}
return $this;
}
/**
* @return Collection<int, OfferComment>
*/
public function getComments(): Collection
{
return $this->comments;
}
public function addText(OfferComment $comments): self
{
if (!$this->comments->contains($comments)) {
$this->comments->add($comments);
$comments->setOffer($this);
}
return $this;
}
public function removeComments(OfferComment $comments): self
{
if ($this->comments->removeElement($comments)) {
// set the owning side to null (unless already changed)
if ($comments->getOffer() === $this) {
$comments->setOffer(null);
}
}
return $this;
}
/**
* @return Collection<int, HistoryOffers>
*/
public function getHistoryOffers(): Collection
{
return $this->historyOffers;
}
public function addHistoryOffer(HistoryOffers $historyOffer): self
{
if (!$this->historyOffers->contains($historyOffer)) {
$this->historyOffers->add($historyOffer);
$historyOffer->setOffer($this);
}
return $this;
}
public function removeHistoryOffer(HistoryOffers $historyOffer): self
{
if ($this->historyOffers->removeElement($historyOffer)) {
// set the owning side to null (unless already changed)
if ($historyOffer->getOffer() === $this) {
$historyOffer->setOffer(null);
}
}
return $this;
}
public function isCompany(): ?bool
{
return $this->company;
}
public function setCompany(?bool $company): self
{
$this->company = $company;
return $this;
}
}