<?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_voyage_categorie")
* @ORM\Entity(repositoryClass="App\Repository\VoyageCategorieRepository")
* @Serializer\ExclusionPolicy("all")
*/
class VoyageCategorie
{
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 $libelle;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $actif = 1;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Voyage", mappedBy="voyageCategorie")
*/
private $voyages;
/**
* @ORM\OneToMany(targetEntity=Dossier::class, mappedBy="categorie")
*/
private $dossiers;
public function __construct()
{
$this->voyages = new ArrayCollection();
$this->dossiers = new ArrayCollection();
}
public function __toString()
{
return $this->libelle;
}
public function getId(): ?int
{
return $this->id;
}
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;
}
/**
* @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->setVoyageCategorie($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->getVoyageCategorie() === $this) {
$voyage->setVoyageCategorie(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->setCategorie($this);
}
return $this;
}
public function removeDossier(Dossier $dossier): self
{
if ($this->dossiers->contains($dossier)) {
$this->dossiers->removeElement($dossier);
// set the owning side to null (unless already changed)
if ($dossier->getCategorie() === $this) {
$dossier->setCategorie(null);
}
}
return $this;
}
}