<?php
namespace App\Entity;
use App\Repository\AvantageRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=AvantageRepository::class)
*/
class Avantage
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $name;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $description;
/**
* @ORM\OneToMany(targetEntity=Imagesavantage::class, mappedBy="avantages", orphanRemoval=true, cascade={"persist"})
*/
private $imagesavantages;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $etat;
/**
* @ORM\ManyToMany(targetEntity=Souscroisiere::class, inversedBy="avantages")
*/
private $souscroisiere;
public function __construct()
{
$this->imagesavantages = 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;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}
/**
* @return Collection<int, Imagesavantage>
*/
public function getImagesavantages(): Collection
{
return $this->imagesavantages;
}
public function addImagesavantage(Imagesavantage $imagesavantage): self
{
if (!$this->imagesavantages->contains($imagesavantage)) {
$this->imagesavantages[] = $imagesavantage;
$imagesavantage->setAvantages($this);
}
return $this;
}
public function removeImagesavantage(Imagesavantage $imagesavantage): self
{
if ($this->imagesavantages->removeElement($imagesavantage)) {
// set the owning side to null (unless already changed)
if ($imagesavantage->getAvantages() === $this) {
$imagesavantage->setAvantages(null);
}
}
return $this;
}
public function isEtat(): ?bool
{
return $this->etat;
}
public function setEtat(?bool $etat): self
{
$this->etat = $etat;
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;
}
return $this;
}
public function removeSouscroisiere(Souscroisiere $souscroisiere): self
{
$this->souscroisiere->removeElement($souscroisiere);
return $this;
}
}