<?php
namespace App\Entity;
use App\Repository\BanniereRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=BanniereRepository::class)
*/
class Banniere
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $name;
/**
* @ORM\Column(type="boolean")
*/
private $etat;
/**
* @ORM\OneToMany(targetEntity=Imagesbannieres::class, mappedBy="bannieres", orphanRemoval=true,cascade={"persist"})
*/
private $imagesbannieres;
public function __construct()
{
$this->imagesbannieres = 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 isEtat(): ?bool
{
return $this->etat;
}
public function setEtat(bool $etat): self
{
$this->etat = $etat;
return $this;
}
/**
* @return Collection<int, Imagesbannieres>
*/
public function getImagesbannieres(): Collection
{
return $this->imagesbannieres;
}
public function addImagesbanniere(Imagesbannieres $imagesbanniere): self
{
if (!$this->imagesbannieres->contains($imagesbanniere)) {
$this->imagesbannieres[] = $imagesbanniere;
$imagesbanniere->setBannieres($this);
}
return $this;
}
public function removeImagesbanniere(Imagesbannieres $imagesbanniere): self
{
if ($this->imagesbannieres->removeElement($imagesbanniere)) {
// set the owning side to null (unless already changed)
if ($imagesbanniere->getBannieres() === $this) {
$imagesbanniere->setBannieres(null);
}
}
return $this;
}
}