src/Entity/Navire.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\NavireRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=NavireRepository::class)
  9.  */
  10. class Navire
  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 $titre;
  22.     /**
  23.      * @ORM\Column(type="text", nullable=true)
  24.      */
  25.     private $longdesc;
  26. //    /**
  27. //     * @ORM\ManyToOne(targetEntity=Technique::class, inversedBy="navire")
  28. //     * @ORM\JoinColumn(nullable=true)
  29. //     */
  30. //    private $technique;
  31.     /**
  32.      * @ORM\OneToMany(targetEntity=Pont::class, mappedBy="navire", orphanRemoval=true)
  33.      */
  34.     private $ponts;
  35.     /**
  36.      * @ORM\OneToMany(targetEntity=Imagesnavire::class, mappedBy="navire", orphanRemoval=true, cascade={"persist"})
  37.      */
  38.     private $imagesnavires;
  39.     /**
  40.      * @ORM\Column(type="text", nullable=true)
  41.      */
  42.     private $technique;
  43.     /**
  44.      * @ORM\OneToMany(targetEntity=Souscroisiere::class, mappedBy="navire")
  45.      */
  46.     private $souscroisiere;
  47.     public function __construct()
  48.     {
  49.         $this->ponts = new ArrayCollection();
  50.         $this->imagesnavires = new ArrayCollection();
  51.         $this->souscroisiere = new ArrayCollection();
  52.     }
  53.     public function __toString()
  54.     {
  55.         return (string) $this->titre;
  56.     }
  57.     public function getId(): ?int
  58.     {
  59.         return $this->id;
  60.     }
  61.     public function getTitre(): ?string
  62.     {
  63.         return $this->titre;
  64.     }
  65.     public function setTitre(?string $titre): self
  66.     {
  67.         $this->titre $titre;
  68.         return $this;
  69.     }
  70.     public function getLongdesc(): ?string
  71.     {
  72.         return $this->longdesc;
  73.     }
  74.     public function setLongdesc(?string $longdesc): self
  75.     {
  76.         $this->longdesc $longdesc;
  77.         return $this;
  78.     }
  79. //    public function getTechnique(): ?Technique
  80. //    {
  81. //        return $this->technique;
  82. //    }
  83. //
  84. //    public function setTechnique(?Technique $technique): self
  85. //    {
  86. //        $this->technique = $technique;
  87. //
  88. //        return $this;
  89. //    }
  90.     /**
  91.      * @return Collection<int, Pont>
  92.      */
  93.     public function getPonts(): Collection
  94.     {
  95.         return $this->ponts;
  96.     }
  97.     public function addPont(Pont $pont): self
  98.     {
  99.         if (!$this->ponts->contains($pont)) {
  100.             $this->ponts[] = $pont;
  101.             $pont->setNavire($this);
  102.         }
  103.         return $this;
  104.     }
  105.     public function removePont(Pont $pont): self
  106.     {
  107.         if ($this->ponts->removeElement($pont)) {
  108.             // set the owning side to null (unless already changed)
  109.             if ($pont->getNavire() === $this) {
  110.                 $pont->setNavire(null);
  111.             }
  112.         }
  113.         return $this;
  114.     }
  115.     /**
  116.      * @return Collection<int, Imagesnavire>
  117.      */
  118.     public function getImagesnavires(): Collection
  119.     {
  120.         return $this->imagesnavires;
  121.     }
  122.     public function addImagesnavire(Imagesnavire $imagesnavire): self
  123.     {
  124.         if (!$this->imagesnavires->contains($imagesnavire)) {
  125.             $this->imagesnavires[] = $imagesnavire;
  126.             $imagesnavire->setNavire($this);
  127.         }
  128.         return $this;
  129.     }
  130.     public function removeImagesnavire(Imagesnavire $imagesnavire): self
  131.     {
  132.         if ($this->imagesnavires->removeElement($imagesnavire)) {
  133.             // set the owning side to null (unless already changed)
  134.             if ($imagesnavire->getNavire() === $this) {
  135.                 $imagesnavire->setNavire(null);
  136.             }
  137.         }
  138.         return $this;
  139.     }
  140.     public function getTechnique(): ?string
  141.     {
  142.         return $this->technique;
  143.     }
  144.     public function setTechnique(?string $technique): self
  145.     {
  146.         $this->technique $technique;
  147.         return $this;
  148.     }
  149.     /**
  150.      * @return Collection<int, Souscroisiere>
  151.      */
  152.     public function getSouscroisiere(): Collection
  153.     {
  154.         return $this->souscroisiere;
  155.     }
  156.     public function addSouscroisiere(Souscroisiere $souscroisiere): self
  157.     {
  158.         if (!$this->souscroisiere->contains($souscroisiere)) {
  159.             $this->souscroisiere[] = $souscroisiere;
  160.             $souscroisiere->setNavire($this);
  161.         }
  162.         return $this;
  163.     }
  164.     public function removeSouscroisiere(Souscroisiere $souscroisiere): self
  165.     {
  166.         if ($this->souscroisiere->removeElement($souscroisiere)) {
  167.             // set the owning side to null (unless already changed)
  168.             if ($souscroisiere->getNavire() === $this) {
  169.                 $souscroisiere->setNavire(null);
  170.             }
  171.         }
  172.         return $this;
  173.     }
  174. }