<?phpnamespace App\Entity;use App\Repository\BandeauRepository;use Doctrine\ORM\Mapping as ORM;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;/** * @ORM\Entity(repositoryClass=BandeauRepository::class) */class Bandeau{ /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="string", length=255) */ private $titre; /** * @ORM\Column(type="text") */ private $description; /** * @ORM\Column(type="string", length=255) */ private $token; /** * @ORM\Column(type="boolean") */ private $actif; /** * @ORM\OneToMany(targetEntity="App\Entity\StockBandeau", mappedBy="bandeau") */ private $stockBandeaux; public function __construct() { $this->stockBandeaux = new ArrayCollection(); } 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 getDescription(): ?string { return $this->description; } public function setDescription(string $description): self { $this->description = $description; return $this; } public function getToken(): ?string { return $this->token; } public function setToken(string $token): self { $this->token = $token; return $this; } public function isActif(): ?bool { return $this->actif; } public function setActif(bool $actif): self { $this->actif = $actif; return $this; } /** * @return Collection<int, StockBandeau> */ public function getStockBandeaux(): Collection { return $this->stockBandeaux; } public function addStockBandeau(StockBandeau $stockBandeau): self { if (!$this->stockBandeaux->contains($stockBandeau)) { $this->stockBandeaux[] = $stockBandeau; $stockBandeau->setBandeau($this); // Mise à jour côté propriétaire } return $this; } public function removeStockBandeau(StockBandeau $stockBandeau): self { if ($this->stockBandeaux->removeElement($stockBandeau)) { if ($stockBandeau->getBandeau() === $this) { $stockBandeau->setBandeau(null); } } return $this; } }