<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use App\Entity\Traits\ActiveTrait;
use App\Entity\Traits\DeleteTrait;
use App\Entity\Traits\SubTitleTrait;
use App\Entity\Traits\TranslateTrait;
use Gedmo\Mapping\Annotation as Gedmo;
use App\Entity\Traits\ImageUploadTrait;
use App\Entity\Interfaces\DefaultEntity;
use App\Entity\Traits\TitleAndContentTrait;
use App\Repository\ImageTextGridRepository;
use Doctrine\Common\Collections\Collection;
use App\Entity\Traits\ThirdImageUploadTrait;
use App\Entity\Traits\FourthImageUploadTrait;
use App\Entity\Traits\SecondImageUploadTrait;
use Doctrine\Common\Collections\ArrayCollection;
use Gedmo\Timestampable\Traits\TimestampableEntity;
use App\Entity\Traits\SortOrderTrait;
/**
* @Gedmo\Loggable
*/
#[ORM\Entity(repositoryClass: ImageTextGridRepository::class)]
class ImageTextGrid implements DefaultEntity
{
use TitleAndContentTrait;
use SubTitleTrait;
use ImageUploadTrait;
use SecondImageUploadTrait;
use ThirdImageUploadTrait;
use FourthImageUploadTrait;
use ActiveTrait;
use DeleteTrait;
use SortOrderTrait;
use TimestampableEntity;
use TranslateTrait;
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type:"integer")]
private $id;
#[ORM\ManyToMany(targetEntity: Page::class, mappedBy: 'imageTextGrids')]
private $pages;
public function __construct()
{
$this->pages = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
/**
* @return Collection<int, Page>
*/
public function getPages(): Collection
{
return $this->pages;
}
public function addPage(Page $page): self
{
if (!$this->pages->contains($page)) {
$this->pages[] = $page;
$page->addImageTextGrid($this);
}
return $this;
}
public function removePage(Page $page): self
{
$this->pages->removeElement($page);
$page->removeImageTextGrid($this);
return $this;
}
}