<?php
namespace App\Entity;
use App\Repository\NavireRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=NavireRepository::class)
*/
class Navire
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $titre;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $longdesc;
// /**
// * @ORM\ManyToOne(targetEntity=Technique::class, inversedBy="navire")
// * @ORM\JoinColumn(nullable=true)
// */
// private $technique;
/**
* @ORM\OneToMany(targetEntity=Pont::class, mappedBy="navire", orphanRemoval=true)
*/
private $ponts;
/**
* @ORM\OneToMany(targetEntity=Imagesnavire::class, mappedBy="navire", orphanRemoval=true, cascade={"persist"})
*/
private $imagesnavires;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $technique;
/**
* @ORM\OneToMany(targetEntity=Souscroisiere::class, mappedBy="navire")
*/
private $souscroisiere;
public function __construct()
{
$this->ponts = new ArrayCollection();
$this->imagesnavires = new ArrayCollection();
$this->souscroisiere = new ArrayCollection();
}
public function __toString()
{
return (string) $this->titre;
}
public function getId(): ?int
{
return $this->id;
}
public function getTitre(): ?string
{
return $this->titre;
}
public function setTitre(?string $titre): self
{
$this->titre = $titre;
return $this;
}
public function getLongdesc(): ?string
{
return $this->longdesc;
}
public function setLongdesc(?string $longdesc): self
{
$this->longdesc = $longdesc;
return $this;
}
// public function getTechnique(): ?Technique
// {
// return $this->technique;
// }
//
// public function setTechnique(?Technique $technique): self
// {
// $this->technique = $technique;
//
// return $this;
// }
/**
* @return Collection<int, Pont>
*/
public function getPonts(): Collection
{
return $this->ponts;
}
public function addPont(Pont $pont): self
{
if (!$this->ponts->contains($pont)) {
$this->ponts[] = $pont;
$pont->setNavire($this);
}
return $this;
}
public function removePont(Pont $pont): self
{
if ($this->ponts->removeElement($pont)) {
// set the owning side to null (unless already changed)
if ($pont->getNavire() === $this) {
$pont->setNavire(null);
}
}
return $this;
}
/**
* @return Collection<int, Imagesnavire>
*/
public function getImagesnavires(): Collection
{
return $this->imagesnavires;
}
public function addImagesnavire(Imagesnavire $imagesnavire): self
{
if (!$this->imagesnavires->contains($imagesnavire)) {
$this->imagesnavires[] = $imagesnavire;
$imagesnavire->setNavire($this);
}
return $this;
}
public function removeImagesnavire(Imagesnavire $imagesnavire): self
{
if ($this->imagesnavires->removeElement($imagesnavire)) {
// set the owning side to null (unless already changed)
if ($imagesnavire->getNavire() === $this) {
$imagesnavire->setNavire(null);
}
}
return $this;
}
public function getTechnique(): ?string
{
return $this->technique;
}
public function setTechnique(?string $technique): self
{
$this->technique = $technique;
return $this;
}
/**
* @return Collection<int, Souscroisiere>
*/
public function getSouscroisiere(): Collection
{
return $this->souscroisiere;
}
public function addSouscroisiere(Souscroisiere $souscroisiere): self
{
if (!$this->souscroisiere->contains($souscroisiere)) {
$this->souscroisiere[] = $souscroisiere;
$souscroisiere->setNavire($this);
}
return $this;
}
public function removeSouscroisiere(Souscroisiere $souscroisiere): self
{
if ($this->souscroisiere->removeElement($souscroisiere)) {
// set the owning side to null (unless already changed)
if ($souscroisiere->getNavire() === $this) {
$souscroisiere->setNavire(null);
}
}
return $this;
}
}