<?phpnamespace App\Entity;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;use JMS\Serializer\Annotation as Serializer;/** * @ORM\Table(name="walkinn_voyage_etat") * @ORM\Entity(repositoryClass="App\Repository\VoyageEtatRepository") * @Serializer\ExclusionPolicy("all") */class VoyageEtat{ 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="string", length=255, nullable=true) */ private $icone; /** * * @ORM\Column(name="color", type="string", length=255, nullable=true) */ private $color; /** * @ORM\Column(type="boolean", nullable=true) */ private $actif = 1; /** * @ORM\OneToMany(targetEntity="App\Entity\Voyage", mappedBy="voyageEtat") */ private $voyages; public function __construct() { $this->voyages = 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 getIcone(): ?string { return $this->icone; } public function setIcone(?string $icone): self { $this->icone = $icone; return $this; } public function getColor(): ?string { return $this->color; } public function setColor(?string $color): self { $this->color = $color; 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->setVoyageEtat($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->getVoyageEtat() === $this) { $voyage->setVoyageEtat(null); } } return $this; }}