src/Entity/Zone.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ZoneRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassZoneRepository::class)]
  8. class Zone
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column()]
  13.     private ?int $id null;
  14.     #[ORM\Column(length255)]
  15.     private ?string $code null;
  16.     #[ORM\Column(length255)]
  17.     private ?string $libelle null;
  18.     #[ORM\Column(length255nullabletrue)]
  19.     private ?string $description null;
  20.     #[ORM\Column(length255nullabletrue)]
  21.     private ?string $dimensions null;
  22.     #[ORM\OneToMany(mappedBy'zone'targetEntityPubImage::class)]
  23.     private Collection $pubImages;
  24.     public function __construct()
  25.     {
  26.         $this->pubImages = new ArrayCollection();
  27.     }
  28.     public function getId(): ?int
  29.     {
  30.         return $this->id;
  31.     }
  32.     public function getCode(): ?string
  33.     {
  34.         return $this->code;
  35.     }
  36.     public function setCode(string $code): self
  37.     {
  38.         $this->code $code;
  39.         return $this;
  40.     }
  41.     public function getLibelle(): ?string
  42.     {
  43.         return $this->libelle;
  44.     }
  45.     public function setLibelle(string $libelle): self
  46.     {
  47.         $this->libelle $libelle;
  48.         return $this;
  49.     }
  50.     public function getDescription(): ?string
  51.     {
  52.         return $this->description;
  53.     }
  54.     public function setDescription(?string $description): self
  55.     {
  56.         $this->description $description;
  57.         return $this;
  58.     }
  59.     public function getDimensions(): ?string
  60.     {
  61.         return $this->dimensions;
  62.     }
  63.     public function setDimensions(?string $dimensions): self
  64.     {
  65.         $this->dimensions $dimensions;
  66.         return $this;
  67.     }
  68.     /**
  69.      * @return Collection<int, PubImage>
  70.      */
  71.     public function getPubImages(): Collection
  72.     {
  73.         return $this->pubImages;
  74.     }
  75.     public function addPubImage(PubImage $pubImage): self
  76.     {
  77.         if (!$this->pubImages->contains($pubImage)) {
  78.             $this->pubImages[] = $pubImage;
  79.             $pubImage->setZone($this);
  80.         }
  81.         return $this;
  82.     }
  83.     public function removePubImage(PubImage $pubImage): self
  84.     {
  85.         if ($this->pubImages->removeElement($pubImage)) {
  86.             // set the owning side to null (unless already changed)
  87.             if ($pubImage->getZone() === $this) {
  88.                 $pubImage->setZone(null);
  89.             }
  90.         }
  91.         return $this;
  92.     }
  93. }