<?php
namespace App\Entity;
use App\Repository\RoutesRepository;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
/**
* @ORM\Entity(repositoryClass=RoutesRepository::class)
* @ORM\Table(name="rn_routes")
*/
class Routes
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $nom;
/**
* @ORM\OneToMany(targetEntity=Fichiers::class, mappedBy="routes",cascade={"persist"}, orphanRemoval=true)
*/
private $fichiers;
/**
* @ORM\OneToMany(targetEntity=Emprunts::class, mappedBy="routes", orphanRemoval=true)
*/
private $emprunts;
/**
* @ORM\OneToMany(targetEntity=PointEaux::class, mappedBy="routes", orphanRemoval=true)
*/
private $pointEaux;
public function __construct()
{
$this->fichiers = new ArrayCollection();
$this->emprunts = new ArrayCollection();
$this->pointEaux = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getNom(): ?string
{
return $this->nom;
}
public function setNom(string $nom): self
{
$this->nom = $nom;
return $this;
}
/**
* @return Collection|Fichiers[]
*/
public function getFichiers(): Collection
{
return $this->fichiers;
}
public function addFichier(Fichiers $fichier): self
{
if (!$this->fichiers->contains($fichier)) {
$this->fichiers[] = $fichier;
$fichier->setRoutes($this);
}
return $this;
}
public function removeFichier(Fichiers $fichier): self
{
if ($this->fichiers->contains($fichier)) {
$this->fichiers->removeElement($fichier);
// set the owning side to null (unless already changed)
if ($fichier->getRoutes() === $this) {
$fichier->setRoutes(null);
}
}
return $this;
}
/**
* @return Collection|Emprunts[]
*/
public function getEmprunts(): Collection
{
return $this->emprunts;
}
public function addEmprunt(Emprunts $emprunt): self
{
if (!$this->emprunts->contains($emprunt)) {
$this->emprunts[] = $emprunt;
$emprunt->setRoutes($this);
}
return $this;
}
public function removeEmprunt(Emprunts $emprunt): self
{
if ($this->emprunts->removeElement($emprunt)) {
// set the owning side to null (unless already changed)
if ($emprunt->getRoutes() === $this) {
$emprunt->setRoutes(null);
}
}
return $this;
}
/**
* @return Collection|PointEaux[]
*/
public function getPointEaux(): Collection
{
return $this->pointEaux;
}
public function addPointEaux(PointEaux $pointEaux): self
{
if (!$this->pointEaux->contains($pointEaux)) {
$this->pointEaux[] = $pointEaux;
$pointEaux->setRoutes($this);
}
return $this;
}
public function removePointEaux(PointEaux $pointEaux): self
{
if ($this->pointEaux->removeElement($pointEaux)) {
// set the owning side to null (unless already changed)
if ($pointEaux->getRoutes() === $this) {
$pointEaux->setRoutes(null);
}
}
return $this;
}
public function __toString() {
return $this->nom;
}
}