<?php
namespace App\Entity;
use App\Repository\AnnouncementRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
#[ORM\Entity(repositoryClass: AnnouncementRepository::class)]
class Announcement
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private $id;
#[ORM\Column(type: 'string', length: 255)]
private $title;
#[ORM\Column(type: 'text')]
private $description;
#[ORM\Column(type: 'boolean')]
private $website = true;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $reference;
#[ORM\ManyToOne(targetEntity: AccountingFirm::class, inversedBy: 'announcements')]
#[ORM\JoinColumn(nullable: false)]
private $accountingFirm;
/**
* @Gedmo\Slug(fields={"title"})
*/
#[ORM\Column(nullable: true)]
private $slug;
#[ORM\OneToMany(targetEntity: ApplyRequest::class, mappedBy: 'annonce', orphanRemoval: true)]
private $applyRequests;
#[ORM\Column(type: 'boolean')]
private $is_primary;
#[ORM\Column(type: 'boolean')]
private $is_spontanee = false;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $img;
// #[ORM\Column(type: 'text', nullable: true)]
// private $info1;
#[ORM\Column(type: 'text', nullable: true)]
private $info2;
#[ORM\Column(type: 'text', nullable: true)]
private $info3;
#[ORM\Column(type: 'text', nullable: true)]
private $info4;
#[ORM\Column(type: 'text', nullable: true)]
private $info5;
#[ORM\Column(type: 'text', nullable: true)]
private $contrat;
#[ORM\Column(type: 'text', nullable: true)]
private $rythme;
#[ORM\Column(type: 'date', nullable: true)]
private $dateDebut;
#[ORM\Column(type: 'text', nullable: true)]
private $diplome;
#[ORM\Column(type: 'text', nullable: true)]
private $anneeExperience;
#[ORM\Column(type: 'json', nullable: true)]
private $outilsLogiciels;
#[ORM\Column(type: 'json', nullable: true)]
private $softs;
#[ORM\Column(type: 'text', nullable: true)]
private $salaire;
#[ORM\Column(type: 'text', nullable: true)]
private $aProposCabinet;
#[ORM\Column(type: 'boolean', nullable: true)]
private $teletravail;
public function __construct()
{
$this->applyRequests = 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 getDescription(): ?string
{
return $this->description;
}
public function setDescription(string $description): self
{
$this->description = $description;
return $this;
}
public function getWebsite(): ?bool
{
return $this->website;
}
public function setWebsite(bool $website): self
{
$this->website = $website;
return $this;
}
public function getReference(): ?string
{
return $this->reference;
}
public function setReference(?string $reference): self
{
$this->reference = $reference;
return $this;
}
public function getAccountingFirm(): ?AccountingFirm
{
return $this->accountingFirm;
}
public function setAccountingFirm(?AccountingFirm $accountingFirm): self
{
$this->accountingFirm = $accountingFirm;
return $this;
}
public function getSlug()
{
return $this->slug;
}
/**
* @return Collection|ApplyRequest[]
*/
public function getApplyRequests(): Collection
{
return $this->applyRequests;
}
public function addApplyRequest(ApplyRequest $applyRequest): self
{
if (!$this->applyRequests->contains($applyRequest)) {
$this->applyRequests[] = $applyRequest;
$applyRequest->setAnnonce($this);
}
return $this;
}
public function removeApplyRequest(ApplyRequest $applyRequest): self
{
if ($this->applyRequests->removeElement($applyRequest)) {
// set the owning side to null (unless already changed)
if ($applyRequest->getAnnonce() === $this) {
$applyRequest->setAnnonce(null);
}
}
return $this;
}
public function isWebsite(): ?bool
{
return $this->website;
}
public function setSlug(?string $slug): self
{
$this->slug = $slug;
return $this;
}
public function getIsPrimary(): ?bool
{
return $this->is_primary;
}
public function setIsPrimary(bool $is_primary): self
{
$this->is_primary = $is_primary;
return $this;
}
public function getIsSpontanee(): ?bool
{
return $this->is_spontanee;
}
public function setIsSpontanee(bool $is_spontanee): self
{
$this->is_spontanee = $is_spontanee;
return $this;
}
public function getImg(): ?string
{
return $this->img;
}
public function setImg(?string $img): self
{
$this->img = $img;
return $this;
}
// public function getInfo1(): ?string
// {
// return $this->info1;
// }
// public function setInfo1(?string $info1): self
// {
// $this->info1 = $info1;
// return $this;
// }
public function getInfo2(): ?string
{
return $this->info2;
}
public function setInfo2(?string $info2): self
{
$this->info2 = $info2;
return $this;
}
public function getInfo3(): ?string
{
return $this->info3;
}
public function setInfo3(?string $info3): self
{
$this->info3 = $info3;
return $this;
}
public function getInfo4(): ?string
{
return $this->info4;
}
public function setInfo4(?string $info4): self
{
$this->info4 = $info4;
return $this;
}
public function getInfo5(): ?string
{
return $this->info5;
}
public function setInfo5(?string $info5): self
{
$this->info5 = $info5;
return $this;
}
public function getUploadPath(): ?string
{
return 'clients/' . $this->accountingFirm->getHost() . '/assets/images/';
}
public function getUploadPathFiles(): ?string
{
return 'clients/' . $this->accountingFirm->getHost() . '/assets/';
}
public function getContrat(): ?string
{
return $this->contrat;
}
public function setContrat(?string $contrat): self
{
$this->contrat = $contrat;
return $this;
}
public function getRythme(): ?string
{
return $this->rythme;
}
public function setRythme(?string $rythme): self
{
$this->rythme = $rythme;
return $this;
}
public function getDateDebut(): ?\DateTimeInterface
{
return $this->dateDebut;
}
public function setDateDebut(?\DateTimeInterface $date_debut): self
{
$this->dateDebut = $date_debut;
return $this;
}
public function getDiplome(): ?string
{
return $this->diplome;
}
public function setDiplome(?string $diplome): self
{
$this->diplome = $diplome;
return $this;
}
public function getAnneeExperience(): ?string
{
return $this->anneeExperience;
}
public function setAnneeExperience(?string $anneeExperience): self
{
$this->anneeExperience = $anneeExperience;
return $this;
}
public function getOutilsLogiciels(): ?array
{
return $this->outilsLogiciels;
}
public function setOutilsLogiciels(?array $outilsLogiciels): self
{
$this->outilsLogiciels = $outilsLogiciels;
return $this;
}
public function addOutilLogiciel(string $outilLogiciel): void
{
$this->outilsLogiciels[] = $outilLogiciel;
}
public function getsofts(): ?array
{
return $this->softs;
}
public function setSofts(?array $softs): self
{
$this->softs = $softs;
return $this;
}
public function addSofts(string $softs): void
{
$this->softs[] = $softs;
}
public function getSalaire(): ?string
{
return $this->salaire;
}
public function setSalaire(?string $salaire): self
{
$this->salaire = $salaire;
return $this;
}
public function getAProposCabinet(): ?string
{
return $this->aProposCabinet;
}
public function setAProposCabinet(?string $aProposCabinet): self
{
$this->aProposCabinet = $aProposCabinet;
return $this;
}
public function getTeletravail(): ?bool
{
return $this->teletravail;
}
public function setTeletravail(bool $teletravail): self
{
$this->teletravail = $teletravail;
return $this;
}
}