src/Entity/Souscroisiere.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\SouscroisiereRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=SouscroisiereRepository::class)
  9.  */
  10. class Souscroisiere
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="string", length=255, nullable=true)
  20.      */
  21.     private $name;
  22.     /**
  23.      * @ORM\Column(type="integer", nullable=true)
  24.      */
  25.     private $duree;
  26.     /**
  27.      * @ORM\Column(type="string", length=255, nullable=true)
  28.      */
  29.     private $destination;
  30.     /**
  31.      * @ORM\OneToMany(targetEntity=Souscroisiereprice::class, mappedBy="souscroisiere", cascade={"persist"})
  32.      */
  33.     private $souscroisiereprices;
  34.     /**
  35.      * @ORM\OneToMany(targetEntity=Souscroisiereroom::class, mappedBy="souscroisiere", cascade={"persist"})
  36.      */
  37.     private $souscroisiererooms;
  38.     /**
  39.      * @ORM\ManyToOne(targetEntity=Croisiere::class, inversedBy="souscroisiere")
  40.      */
  41.     private $croisiere;
  42.     /**
  43.      * @ORM\OneToMany(targetEntity=Imagessouscroisiere::class, mappedBy="souscroisieres", orphanRemoval=true,cascade={"persist"})
  44.      */
  45.     private $imagessouscroisieres;
  46.     /**
  47.      * @ORM\Column(type="text", nullable=true)
  48.      */
  49.     private $itineraire;
  50.     /**
  51.      * @ORM\ManyToOne(targetEntity=Navire::class, inversedBy="souscroisieres")
  52.      */
  53.     private $navire;
  54.     /**
  55.      * @ORM\ManyToMany(targetEntity=Avantage::class, inversedBy="souscroisieres")
  56.      */
  57.     private $avantages;
  58.     /**
  59.      * @ORM\Column(type="boolean", nullable=true)
  60.      */
  61.     private $etat;
  62.     public function __construct()
  63.     {
  64.         $this->souscroisiereprices = new ArrayCollection();
  65.         $this->souscroisiererooms = new ArrayCollection();
  66.         $this->imagessouscroisieres = new ArrayCollection();
  67.         $this->avantages = new ArrayCollection();
  68.     }
  69.     public function __toString()
  70.     {
  71.         return (string)$this->name;
  72.     }
  73.     public function getId(): ?int
  74.     {
  75.         return $this->id;
  76.     }
  77.     public function getName(): ?string
  78.     {
  79.         return $this->name;
  80.     }
  81.     public function setName(?string $name): self
  82.     {
  83.         $this->name $name;
  84.         return $this;
  85.     }
  86.     public function getDuree(): ?int
  87.     {
  88.         return $this->duree;
  89.     }
  90.     public function setDuree(?int $duree): self
  91.     {
  92.         $this->duree $duree;
  93.         return $this;
  94.     }
  95.     public function getDestination(): ?string
  96.     {
  97.         return $this->destination;
  98.     }
  99.     public function setDestination(?string $destination): self
  100.     {
  101.         $this->destination $destination;
  102.         return $this;
  103.     }
  104.     /**
  105.      * @return Collection<int, Souscroisiereprice>
  106.      */
  107.     public function getSouscroisiereprices(): Collection
  108.     {
  109.         return $this->souscroisiereprices;
  110.     }
  111.     public function addSouscroisiereprice(Souscroisiereprice $souscroisiereprice): self
  112.     {
  113.         if (!$this->souscroisiereprices->contains($souscroisiereprice)) {
  114.             $this->souscroisiereprices[] = $souscroisiereprice;
  115.             $souscroisiereprice->setSouscroisiere($this);
  116.         }
  117.         return $this;
  118.     }
  119.     public function removeSouscroisiereprice(Souscroisiereprice $souscroisiereprice): self
  120.     {
  121.         if ($this->souscroisiereprices->removeElement($souscroisiereprice)) {
  122.             // set the owning side to null (unless already changed)
  123.             if ($souscroisiereprice->getSouscroisiere() === $this) {
  124.                 $souscroisiereprice->setSouscroisiere(null);
  125.             }
  126.         }
  127.         return $this;
  128.     }
  129.     /**
  130.      * @return Collection<int, Souscroisiereroom>
  131.      */
  132.     public function getSouscroisiererooms(): Collection
  133.     {
  134.         return $this->souscroisiererooms;
  135.     }
  136.     public function addSouscroisiereroom(Souscroisiereroom $souscroisiereroom): self
  137.     {
  138.         if (!$this->souscroisiererooms->contains($souscroisiereroom)) {
  139.             $this->souscroisiererooms[] = $souscroisiereroom;
  140.             $souscroisiereroom->setSouscroisiere($this);
  141.         }
  142.         return $this;
  143.     }
  144.     public function removeSouscroisiereroom(Souscroisiereroom $souscroisiereroom): self
  145.     {
  146.         if ($this->souscroisiererooms->removeElement($souscroisiereroom)) {
  147.             // set the owning side to null (unless already changed)
  148.             if ($souscroisiereroom->getSouscroisiere() === $this) {
  149.                 $souscroisiereroom->setSouscroisiere(null);
  150.             }
  151.         }
  152.         return $this;
  153.     }
  154.     public function getCroisiere(): ?Croisiere
  155.     {
  156.         return $this->croisiere;
  157.     }
  158.     public function setCroisiere(?Croisiere $croisiere): self
  159.     {
  160.         $this->croisiere $croisiere;
  161.         return $this;
  162.     }
  163.     /**
  164.      * @return Collection<int, Imagessouscroisiere>
  165.      */
  166.     public function getImagessouscroisieres(): Collection
  167.     {
  168.         return $this->imagessouscroisieres;
  169.     }
  170.     public function addImagessouscroisiere(Imagessouscroisiere $imagessouscroisiere): self
  171.     {
  172.         if (!$this->imagessouscroisieres->contains($imagessouscroisiere)) {
  173.             $this->imagessouscroisieres[] = $imagessouscroisiere;
  174.             $imagessouscroisiere->setSouscroisieres($this);
  175.         }
  176.         return $this;
  177.     }
  178.     public function removeImagessouscroisiere(Imagessouscroisiere $imagessouscroisiere): self
  179.     {
  180.         if ($this->imagessouscroisieres->removeElement($imagessouscroisiere)) {
  181.             // set the owning side to null (unless already changed)
  182.             if ($imagessouscroisiere->getSouscroisieres() === $this) {
  183.                 $imagessouscroisiere->setSouscroisieres(null);
  184.             }
  185.         }
  186.         return $this;
  187.     }
  188.     public function getItineraire(): ?string
  189.     {
  190.         return $this->itineraire;
  191.     }
  192.     public function setItineraire(?string $itineraire): self
  193.     {
  194.         $this->itineraire $itineraire;
  195.         return $this;
  196.     }
  197.     public function getNavire(): ?Navire
  198.     {
  199.         return $this->navire;
  200.     }
  201.     public function setNavire(?Navire $navire): self
  202.     {
  203.         $this->navire $navire;
  204.         return $this;
  205.     }
  206.     /**
  207.      * @return Collection<int, Avantage>
  208.      */
  209.     public function getAvantages(): Collection
  210.     {
  211.         return $this->avantages;
  212.     }
  213.     public function addAvantage(Avantage $avantage): self
  214.     {
  215.         if (!$this->avantages->contains($avantage)) {
  216.             $this->avantages[] = $avantage;
  217.         }
  218.         return $this;
  219.     }
  220.     public function removeAvantage(Avantage $avantage): self
  221.     {
  222.         $this->avantages->removeElement($avantage);
  223.         return $this;
  224.     }
  225.     public function isEtat(): ?bool
  226.     {
  227.         return $this->etat;
  228.     }
  229.     public function setEtat(?bool $etat): self
  230.     {
  231.         $this->etat $etat;
  232.         return $this;
  233.     }
  234. }