<?phpnamespace App\Entity;use App\Repository\PublicationImageRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity(repositoryClass=PublicationImageRepository::class) */class PublicationImage{ /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="string", length=255) */ private $name; /** * @ORM\Column(type="string", length=255) */ private $path; /** * @ORM\OneToMany(targetEntity=Publication::class, mappedBy="publicationImage") */ private $publications; public function __construct() { $this->publications = 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 getPath(): ?string { return $this->path; } public function setPath(string $path): self { $this->path = $path; return $this; } /** * @return Collection|Publication[] */ public function getPublications(): Collection { return $this->publications; } public function addPublication(Publication $publication): self { if (!$this->publications->contains($publication)) { $this->publications[] = $publication; $publication->setPublicationImage($this); } return $this; } public function removePublication(Publication $publication): self { if ($this->publications->removeElement($publication)) { // set the owning side to null (unless already changed) if ($publication->getPublicationImage() === $this) { $publication->setPublicationImage(null); } } return $this; }}