*/ #[ORM\OneToMany(mappedBy: 'repository', targetEntity: Image::class)] private Collection $images; public function __construct() { parent::__construct(); $this->images = new ArrayCollection(); } public function getIp(): ?string { return $this->ip; } public function setIp(string $ip): static { $this->ip = $ip; return $this; } public function getComments(): ?string { return $this->comments; } public function setComments(?string $comments): static { $this->comments = $comments; return $this; } /** * @return Collection */ public function getImages(): Collection { return $this->images; } public function addImage(Image $image): static { if (!$this->images->contains($image)) { $this->images->add($image); $image->setRepository($this); } return $this; } public function removeImage(Image $image): static { if ($this->images->removeElement($image)) { // set the owning side to null (unless already changed) if ($image->getRepository() === $this) { $image->setRepository(null); } } return $this; } }