<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use JMS\Serializer\Annotation as Serializer;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Table(name="walkinn_destination")
* @ORM\Entity(repositoryClass="App\Repository\DestinationRepository")
* @Serializer\ExclusionPolicy("all")
*/
class Destination
{
use \App\Traits\Timestampable;
use \App\Traits\Blameable;
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $code;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $libelle;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $actif = 1;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Country", inversedBy="destinations")
*/
private $country;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Voyage", mappedBy="destination")
*/
private $voyages;
/**
* @ORM\OneToMany(targetEntity=Editorial::class, mappedBy="destination")
*/
private $editorials;
/**
* @ORM\ManyToMany(targetEntity=Dossier::class, mappedBy="destinations")
*/
private $dossiers;
/**
* @ORM\Column(type="float", nullable=true)
*/
private $percentage;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $useCession;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $adresse;
/**
* @ORM\Column(type="string", length=30, nullable=true)
*/
private $zip;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $town;
/**
* @ORM\Column(type="string", length=50, nullable=true)
*/
private $phone;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $countryLabel;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $emetteurLabel;
/**
* @ORM\Column(type="string", length=31, nullable=true)
*/
private $emetteurSiret;
/**
* @ORM\Column(type="string", length=63, nullable=true)
*/
private $emetteurTVA;
/**
* @ORM\Column(type="string", length=25, nullable=true)
*/
private $codeComptable;
public function __construct()
{
$this->voyages = new ArrayCollection();
$this->editorials = new ArrayCollection();
$this->dossiers = new ArrayCollection();
}
public function __toString()
{
return $this->libelle;
}
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 getLibelle(): ?string
{
return $this->libelle;
}
public function setLibelle(?string $libelle): self
{
$this->libelle = $libelle;
return $this;
}
public function getActif(): ?bool
{
return $this->actif;
}
public function setActif(?bool $actif): self
{
$this->actif = $actif;
return $this;
}
public function getCountry(): ?Country
{
return $this->country;
}
public function setCountry(?Country $country): self
{
$this->country = $country;
return $this;
}
/**
* @return Collection|Voyage[]
*/
public function getVoyages(): Collection
{
return $this->voyages;
}
public function addVoyage(Voyage $voyage): self
{
if (!$this->voyages->contains($voyage)) {
$this->voyages[] = $voyage;
$voyage->setDestination($this);
}
return $this;
}
public function removeVoyage(Voyage $voyage): self
{
if ($this->voyages->contains($voyage)) {
$this->voyages->removeElement($voyage);
// set the owning side to null (unless already changed)
if ($voyage->getDestination() === $this) {
$voyage->setDestination(null);
}
}
return $this;
}
/**
* @return Collection|Editorial[]
*/
public function getEditorials(): Collection
{
return $this->editorials;
}
public function addEditorial(Editorial $editorial): self
{
if (!$this->editorials->contains($editorial)) {
$this->editorials[] = $editorial;
$editorial->setDestination($this);
}
return $this;
}
public function removeEditorial(Editorial $editorial): self
{
if ($this->editorials->contains($editorial)) {
$this->editorials->removeElement($editorial);
// set the owning side to null (unless already changed)
if ($editorial->getDestination() === $this) {
$editorial->setDestination(null);
}
}
return $this;
}
/**
* @return Collection|Dossier[]
*/
public function getDossiers(): Collection
{
return $this->dossiers;
}
public function addDossier(Dossier $dossier): self
{
if (!$this->dossiers->contains($dossier)) {
$this->dossiers[] = $dossier;
$dossier->addDestination($this);
}
return $this;
}
public function removeDossier(Dossier $dossier): self
{
if ($this->dossiers->contains($dossier)) {
$this->dossiers->removeElement($dossier);
$dossier->removeDestination($this);
}
return $this;
}
public function getPercentage(): ?float
{
return $this->percentage;
}
public function setPercentage(?float $percentage): self
{
$this->percentage = $percentage;
return $this;
}
public function getUseCession(): ?bool
{
return $this->useCession;
}
public function setUseCession(?bool $useCession): self
{
$this->useCession = $useCession;
return $this;
}
public function getAdresse(): ?string
{
return $this->adresse;
}
public function setAdresse(?string $adresse): self
{
$this->adresse = $adresse;
return $this;
}
public function getZip(): ?string
{
return $this->zip;
}
public function setZip(?string $zip): self
{
$this->zip = $zip;
return $this;
}
public function getTown(): ?string
{
return $this->town;
}
public function setTown(?string $town): self
{
$this->town = $town;
return $this;
}
public function getPhone(): ?string
{
return $this->phone;
}
public function setPhone(?string $phone): self
{
$this->phone = $phone;
return $this;
}
public function getCountryLabel(): ?string
{
return $this->countryLabel;
}
public function setCountryLabel(?string $countryLabel): self
{
$this->countryLabel = $countryLabel;
return $this;
}
public function getEmetteurLabel(): ?string
{
return $this->emetteurLabel;
}
public function setEmetteurLabel(?string $emetteurLabel): self
{
$this->emetteurLabel = $emetteurLabel;
return $this;
}
public function getEmetteurSiret(): ?string
{
return $this->emetteurSiret;
}
public function setEmetteurSiret(?string $emetteurSiret): self
{
$this->emetteurSiret = $emetteurSiret;
return $this;
}
public function getEmetteurTVA(): ?string
{
return $this->emetteurTVA;
}
public function setEmetteurTVA(?string $emetteurTVA): self
{
$this->emetteurTVA = $emetteurTVA;
return $this;
}
public function getCodeComptable(): ?string
{
return $this->codeComptable;
}
public function setCodeComptable(?string $codeComptable): self
{
$this->codeComptable = $codeComptable;
return $this;
}
}