src/Entity/Croisiere.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\CroisiereRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=CroisiereRepository::class)
  9.  */
  10. class Croisiere
  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\OneToMany(targetEntity=Imagescroisiere::class, mappedBy="croisieres", orphanRemoval=true, cascade={"persist"})
  24.      */
  25.     private $imagescroisieres;
  26.     /**
  27.      * @ORM\OneToMany(targetEntity=Souscroisiere::class, mappedBy="croisiere")
  28.      */
  29.     private $souscroisiere;
  30.     /**
  31.      * @ORM\Column(type="boolean", nullable=true)
  32.      */
  33.     private $etat;
  34.     public function __construct()
  35.     {
  36.         $this->imagescroisieres = new ArrayCollection();
  37.         $this->souscroisiere = new ArrayCollection();
  38.     }
  39.     public function getId(): ?int
  40.     {
  41.         return $this->id;
  42.     }
  43.     public function getName(): ?string
  44.     {
  45.         return $this->name;
  46.     }
  47.     public function setName(?string $name): self
  48.     {
  49.         $this->name $name;
  50.         return $this;
  51.     }
  52.     /**
  53.      * @return Collection<int, Imagescroisiere>
  54.      */
  55.     public function getImagescroisieres(): Collection
  56.     {
  57.         return $this->imagescroisieres;
  58.     }
  59.     public function addImagescroisiere(Imagescroisiere $imagescroisiere): self
  60.     {
  61.         if (!$this->imagescroisieres->contains($imagescroisiere)) {
  62.             $this->imagescroisieres[] = $imagescroisiere;
  63.             $imagescroisiere->setCroisieres($this);
  64.         }
  65.         return $this;
  66.     }
  67.     public function removeImagescroisiere(Imagescroisiere $imagescroisiere): self
  68.     {
  69.         if ($this->imagescroisieres->removeElement($imagescroisiere)) {
  70.             // set the owning side to null (unless already changed)
  71.             if ($imagescroisiere->getCroisieres() === $this) {
  72.                 $imagescroisiere->setCroisieres(null);
  73.             }
  74.         }
  75.         return $this;
  76.     }
  77.     /**
  78.      * @return Collection<int, Souscroisiere>
  79.      */
  80.     public function getSouscroisiere(): Collection
  81.     {
  82.         return $this->souscroisiere;
  83.     }
  84.     public function addSouscroisiere(Souscroisiere $souscroisiere): self
  85.     {
  86.         if (!$this->souscroisiere->contains($souscroisiere)) {
  87.             $this->souscroisiere[] = $souscroisiere;
  88.             $souscroisiere->setCroisiere($this);
  89.         }
  90.         return $this;
  91.     }
  92.     public function removeSouscroisiere(Souscroisiere $souscroisiere): self
  93.     {
  94.         if ($this->souscroisiere->removeElement($souscroisiere)) {
  95.             // set the owning side to null (unless already changed)
  96.             if ($souscroisiere->getCroisiere() === $this) {
  97.                 $souscroisiere->setCroisiere(null);
  98.             }
  99.         }
  100.         return $this;
  101.     }
  102.     public function isEtat(): ?bool
  103.     {
  104.         return $this->etat;
  105.     }
  106.     public function setEtat(?bool $etat): self
  107.     {
  108.         $this->etat $etat;
  109.         return $this;
  110.     }
  111. }