<?php
namespace App\Entity;
use App\Repository\ZoneRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: ZoneRepository::class)]
class Zone
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column()]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $code = null;
#[ORM\Column(length: 255)]
private ?string $libelle = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $description = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $dimensions = null;
#[ORM\OneToMany(mappedBy: 'zone', targetEntity: PubImage::class)]
private Collection $pubImages;
public function __construct()
{
$this->pubImages = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getCode(): ?string
{
return $this->code;
}
public function setCode(string $code): self
{
$this->code = $code;
return $this;
}
public function getLibelle(): ?string
{
return $this->libelle;
}
public function setLibelle(string $libelle): self
{
$this->libelle = $libelle;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}
public function getDimensions(): ?string
{
return $this->dimensions;
}
public function setDimensions(?string $dimensions): self
{
$this->dimensions = $dimensions;
return $this;
}
/**
* @return Collection<int, PubImage>
*/
public function getPubImages(): Collection
{
return $this->pubImages;
}
public function addPubImage(PubImage $pubImage): self
{
if (!$this->pubImages->contains($pubImage)) {
$this->pubImages[] = $pubImage;
$pubImage->setZone($this);
}
return $this;
}
public function removePubImage(PubImage $pubImage): self
{
if ($this->pubImages->removeElement($pubImage)) {
// set the owning side to null (unless already changed)
if ($pubImage->getZone() === $this) {
$pubImage->setZone(null);
}
}
return $this;
}
}