<?phpnamespace App\Entity;use App\Repository\WebMapPopupTemplateRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity(repositoryClass=WebMapPopupTemplateRepository::class) */class WebMapPopupTemplate{ /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="string", length=255) */ private $name; /** * @ORM\Column(type="string", length=255, nullable=true) */ private $gabaritName; /** * @ORM\Column(type="string", length=255, nullable=true) */ private $thumbnail; /** * @ORM\Column(type="string", length=255, nullable=true) */ private $preview; /** * @ORM\Column(type="json", nullable=true) */ private $parameters; /** * @ORM\OneToMany(targetEntity=WebMap::class, mappedBy="popupTemplate") */ private $webMaps; public function __construct() { $this->webMaps = 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 getGabaritName(): ?string { return $this->gabaritName; } public function setGabaritName(?string $gabaritName): self { $this->gabaritName = $gabaritName; return $this; } public function getThumbnail(): ?string { return $this->thumbnail; } public function setThumbnail(?string $thumbnail): self { $this->thumbnail = $thumbnail; return $this; } public function getPreview(): ?string { return $this->preview; } public function setPreview(?string $preview): self { $this->preview = $preview; return $this; } public function getParameters(): ?array { return $this->parameters; } public function setParameters(?array $parameters): self { $this->parameters = $parameters; return $this; } /** * @return Collection|WebMap[] */ public function getWebMaps(): Collection { return $this->webMaps; } public function addWebMap(WebMap $webMap): self { if (!$this->webMaps->contains($webMap)) { $this->webMaps[] = $webMap; // ajouter aussi la relation correspondante de l'autre côté pour éviter les incohérences $webMap->setMapPopupTemplate($this); } return $this; } public function removeWebMap(WebMap $webMap): self { if ($this->webMaps->contains($webMap)) { $this->webMaps->removeElement($webMap); // passer l'autre côté à null pour éviter les incohérences if ($webMap->getPopupTemplate() === $this) { $webMap->setPopupTemplate(null); } } return $this; }}