<?php
namespace App\Entity;
use App\Repository\CroisiereRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=CroisiereRepository::class)
*/
class Croisiere
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $name;
/**
* @ORM\OneToMany(targetEntity=Imagescroisiere::class, mappedBy="croisieres", orphanRemoval=true, cascade={"persist"})
*/
private $imagescroisieres;
/**
* @ORM\OneToMany(targetEntity=Souscroisiere::class, mappedBy="croisiere")
*/
private $souscroisiere;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $etat;
public function __construct()
{
$this->imagescroisieres = new ArrayCollection();
$this->souscroisiere = new ArrayCollection();
}
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;
}
/**
* @return Collection<int, Imagescroisiere>
*/
public function getImagescroisieres(): Collection
{
return $this->imagescroisieres;
}
public function addImagescroisiere(Imagescroisiere $imagescroisiere): self
{
if (!$this->imagescroisieres->contains($imagescroisiere)) {
$this->imagescroisieres[] = $imagescroisiere;
$imagescroisiere->setCroisieres($this);
}
return $this;
}
public function removeImagescroisiere(Imagescroisiere $imagescroisiere): self
{
if ($this->imagescroisieres->removeElement($imagescroisiere)) {
// set the owning side to null (unless already changed)
if ($imagescroisiere->getCroisieres() === $this) {
$imagescroisiere->setCroisieres(null);
}
}
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->setCroisiere($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->getCroisiere() === $this) {
$souscroisiere->setCroisiere(null);
}
}
return $this;
}
public function isEtat(): ?bool
{
return $this->etat;
}
public function setEtat(?bool $etat): self
{
$this->etat = $etat;
return $this;
}
}