src/Entity/Page.php line 18

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Traits\CommonTrait;
  4. use App\Repository\PageRepository;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  9. /**
  10.  * @ORM\Entity(repositoryClass=PageRepository::class)
  11.  * @ORM\Table(name="app_page")
  12.  * @ORM\HasLifecycleCallbacks()
  13.  * @UniqueEntity({"uuid"})
  14.  */
  15. class Page
  16. {
  17.     use CommonTrait;
  18.     /**
  19.      * @ORM\Column(type="string", length=255)
  20.      */
  21.     private $name;
  22.     /**
  23.      * @ORM\Column(type="string", length=255, unique=true)
  24.      */
  25.     private $url;
  26.     /**
  27.      * @ORM\ManyToMany(targetEntity=PageSection::class)
  28.      * @ORM\JoinTable(name="app_page_top_section")
  29.      */
  30.     private $topContent;
  31.     /**
  32.      * @ORM\ManyToMany(targetEntity=PageSection::class)
  33.      * @ORM\JoinTable(name="app_page_middle_section")
  34.      */
  35.     private $middleContent;
  36.     /**
  37.      * @ORM\ManyToMany(targetEntity=PageSection::class)
  38.      * @ORM\JoinTable(name="app_page_bottom_section")
  39.      */
  40.     private $bottomContent;
  41.     /**
  42.      * @ORM\Column(type="boolean", nullable=true)
  43.      */
  44.     private $isSystemPage;
  45.     /**
  46.      * @ORM\Column(type="string", length=255)
  47.      */
  48.     private $uKey;
  49.     public function __construct()
  50.     {
  51.         $this->topContent = new ArrayCollection();
  52.         $this->middleContent = new ArrayCollection();
  53.         $this->bottomContent = new ArrayCollection();
  54.     }
  55.     public function getName(): ?string
  56.     {
  57.         return $this->name;
  58.     }
  59.     public function setName(string $name): self
  60.     {
  61.         $this->name $name;
  62.         return $this;
  63.     }
  64.     public function getUrl(): ?string
  65.     {
  66.         return $this->url;
  67.     }
  68.     public function setUrl(string $url): self
  69.     {
  70.         $this->url $url;
  71.         return $this;
  72.     }
  73.     /**
  74.      * @return Collection<int, PageSection>
  75.      */
  76.     public function getTopContent(): Collection
  77.     {
  78.         return $this->topContent;
  79.     }
  80.     public function addTopContent(PageSection $topContent): self
  81.     {
  82.         if (!$this->topContent->contains($topContent)) {
  83.             $this->topContent[] = $topContent;
  84.         }
  85.         return $this;
  86.     }
  87.     public function removeTopContent(PageSection $topContent): self
  88.     {
  89.         $this->topContent->removeElement($topContent);
  90.         return $this;
  91.     }
  92.     /**
  93.      * @return Collection<int, PageSection>
  94.      */
  95.     public function getMiddleContent(): Collection
  96.     {
  97.         return $this->middleContent;
  98.     }
  99.     public function addMiddleContent(PageSection $middleContent): self
  100.     {
  101.         if (!$this->middleContent->contains($middleContent)) {
  102.             $this->middleContent[] = $middleContent;
  103.         }
  104.         return $this;
  105.     }
  106.     public function removeMiddleContent(PageSection $middleContent): self
  107.     {
  108.         $this->middleContent->removeElement($middleContent);
  109.         return $this;
  110.     }
  111.     /**
  112.      * @return Collection<int, PageSection>
  113.      */
  114.     public function getBottomContent(): Collection
  115.     {
  116.         return $this->bottomContent;
  117.     }
  118.     public function addBottomContent(PageSection $bottomContent): self
  119.     {
  120.         if (!$this->bottomContent->contains($bottomContent)) {
  121.             $this->bottomContent[] = $bottomContent;
  122.         }
  123.         return $this;
  124.     }
  125.     public function removeBottomContent(PageSection $bottomContent): self
  126.     {
  127.         $this->bottomContent->removeElement($bottomContent);
  128.         return $this;
  129.     }
  130.     public function getIsSystemPage(): ?bool
  131.     {
  132.         return $this->isSystemPage;
  133.     }
  134.     public function setIsSystemPage(?bool $isSystemPage): self
  135.     {
  136.         $this->isSystemPage $isSystemPage;
  137.         return $this;
  138.     }
  139.     public function getUKey(): ?string
  140.     {
  141.         return $this->uKey;
  142.     }
  143.     public function setUKey(string $uKey): self
  144.     {
  145.         $this->uKey $uKey;
  146.         return $this;
  147.     }
  148. }