<?phpnamespace App\Entity\Image;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;/** * ImgPublication */#[ORM\Table(name: 'img_publication')]#[ORM\Entity(repositoryClass: \App\Repository\Image\ImgPublicationRepository::class)]class ImgPublication implements \Stringable{ #[ORM\Column(name: 'id', type: 'integer')] #[ORM\Id] #[ORM\GeneratedValue(strategy: 'AUTO')] private ?int $id = null; #[ORM\Column(name: 'name', type: 'string', length: 255)] private ?string $name = null; #[ORM\Column(name: 'active', type: 'boolean')] private ?bool $active = null; #[ORM\ManyToMany(targetEntity: \App\Entity\Image\Image::class, mappedBy: 'imgPublications')] private $images; public function __construct() { $this->images = new ArrayCollection(); } /** * Get id. * * @return int */ public function getId() { return $this->id; } /** * Set name. * * @param string $name * * @return ImgPublication */ public function setName($name) { $this->name = $name; return $this; } /** * Get name. * * @return string */ public function getName() { return $this->name; } /** * Set active. * * @param bool $active * * @return ImgPublication */ public function setActive($active) { $this->active = $active; return $this; } /** * Get active. * * @return bool */ public function getActive() { return $this->active; } /** * @return Collection|Article[] */ public function getImages(): Collection { return $this->images; } public function addImage(Image $image): self { if (!$this->images->contains($image)) { $this->images[] = $image; $image->addImgPublication($this); } return $this; } public function removeImage(Image $image): self { if ($this->images->contains($image)) { $this->images->removeElement($image); $image->removeImgPublication($this); } return $this; } public function __toString(): string { Return $this->name; }}