<?php
namespace App\Entity;
use App\Repository\SouscroisiereRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=SouscroisiereRepository::class)
*/
class Souscroisiere
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $name;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $duree;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $destination;
/**
* @ORM\OneToMany(targetEntity=Souscroisiereprice::class, mappedBy="souscroisiere", cascade={"persist"})
*/
private $souscroisiereprices;
/**
* @ORM\OneToMany(targetEntity=Souscroisiereroom::class, mappedBy="souscroisiere", cascade={"persist"})
*/
private $souscroisiererooms;
/**
* @ORM\ManyToOne(targetEntity=Croisiere::class, inversedBy="souscroisiere")
*/
private $croisiere;
/**
* @ORM\OneToMany(targetEntity=Imagessouscroisiere::class, mappedBy="souscroisieres", orphanRemoval=true,cascade={"persist"})
*/
private $imagessouscroisieres;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $itineraire;
/**
* @ORM\ManyToOne(targetEntity=Navire::class, inversedBy="souscroisieres")
*/
private $navire;
/**
* @ORM\ManyToMany(targetEntity=Avantage::class, inversedBy="souscroisieres")
*/
private $avantages;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $etat;
public function __construct()
{
$this->souscroisiereprices = new ArrayCollection();
$this->souscroisiererooms = new ArrayCollection();
$this->imagessouscroisieres = new ArrayCollection();
$this->avantages = new ArrayCollection();
}
public function __toString()
{
return (string)$this->name;
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(?string $name): self
{
$this->name = $name;
return $this;
}
public function getDuree(): ?int
{
return $this->duree;
}
public function setDuree(?int $duree): self
{
$this->duree = $duree;
return $this;
}
public function getDestination(): ?string
{
return $this->destination;
}
public function setDestination(?string $destination): self
{
$this->destination = $destination;
return $this;
}
/**
* @return Collection<int, Souscroisiereprice>
*/
public function getSouscroisiereprices(): Collection
{
return $this->souscroisiereprices;
}
public function addSouscroisiereprice(Souscroisiereprice $souscroisiereprice): self
{
if (!$this->souscroisiereprices->contains($souscroisiereprice)) {
$this->souscroisiereprices[] = $souscroisiereprice;
$souscroisiereprice->setSouscroisiere($this);
}
return $this;
}
public function removeSouscroisiereprice(Souscroisiereprice $souscroisiereprice): self
{
if ($this->souscroisiereprices->removeElement($souscroisiereprice)) {
// set the owning side to null (unless already changed)
if ($souscroisiereprice->getSouscroisiere() === $this) {
$souscroisiereprice->setSouscroisiere(null);
}
}
return $this;
}
/**
* @return Collection<int, Souscroisiereroom>
*/
public function getSouscroisiererooms(): Collection
{
return $this->souscroisiererooms;
}
public function addSouscroisiereroom(Souscroisiereroom $souscroisiereroom): self
{
if (!$this->souscroisiererooms->contains($souscroisiereroom)) {
$this->souscroisiererooms[] = $souscroisiereroom;
$souscroisiereroom->setSouscroisiere($this);
}
return $this;
}
public function removeSouscroisiereroom(Souscroisiereroom $souscroisiereroom): self
{
if ($this->souscroisiererooms->removeElement($souscroisiereroom)) {
// set the owning side to null (unless already changed)
if ($souscroisiereroom->getSouscroisiere() === $this) {
$souscroisiereroom->setSouscroisiere(null);
}
}
return $this;
}
public function getCroisiere(): ?Croisiere
{
return $this->croisiere;
}
public function setCroisiere(?Croisiere $croisiere): self
{
$this->croisiere = $croisiere;
return $this;
}
/**
* @return Collection<int, Imagessouscroisiere>
*/
public function getImagessouscroisieres(): Collection
{
return $this->imagessouscroisieres;
}
public function addImagessouscroisiere(Imagessouscroisiere $imagessouscroisiere): self
{
if (!$this->imagessouscroisieres->contains($imagessouscroisiere)) {
$this->imagessouscroisieres[] = $imagessouscroisiere;
$imagessouscroisiere->setSouscroisieres($this);
}
return $this;
}
public function removeImagessouscroisiere(Imagessouscroisiere $imagessouscroisiere): self
{
if ($this->imagessouscroisieres->removeElement($imagessouscroisiere)) {
// set the owning side to null (unless already changed)
if ($imagessouscroisiere->getSouscroisieres() === $this) {
$imagessouscroisiere->setSouscroisieres(null);
}
}
return $this;
}
public function getItineraire(): ?string
{
return $this->itineraire;
}
public function setItineraire(?string $itineraire): self
{
$this->itineraire = $itineraire;
return $this;
}
public function getNavire(): ?Navire
{
return $this->navire;
}
public function setNavire(?Navire $navire): self
{
$this->navire = $navire;
return $this;
}
/**
* @return Collection<int, Avantage>
*/
public function getAvantages(): Collection
{
return $this->avantages;
}
public function addAvantage(Avantage $avantage): self
{
if (!$this->avantages->contains($avantage)) {
$this->avantages[] = $avantage;
}
return $this;
}
public function removeAvantage(Avantage $avantage): self
{
$this->avantages->removeElement($avantage);
return $this;
}
public function isEtat(): ?bool
{
return $this->etat;
}
public function setEtat(?bool $etat): self
{
$this->etat = $etat;
return $this;
}
}