src/Entity/StaticPage.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7.  * @ORM\Entity(repositoryClass="App\Repository\StaticPageRepository")
  8.  *
  9.  * @ORM\HasLifecycleCallbacks()
  10.  */
  11. class StaticPage
  12. {
  13.     public function __construct()
  14.     {
  15.         $this->menus = new ArrayCollection();
  16.         $this->static_page_blocks = new ArrayCollection();
  17.         $this->channels_homepages = new ArrayCollection();
  18.     }
  19.     /**
  20.      * @ORM\Id()
  21.      *
  22.      * @ORM\GeneratedValue()
  23.      *
  24.      * @ORM\Column(type="integer")
  25.      */
  26.     private $id;
  27.     /**
  28.      * @ORM\Column(type="string", nullable=false, length=180)
  29.      */
  30.     private $slug null;
  31.     /**
  32.      * @ORM\Column(type="string", nullable=false, length=180)
  33.      */
  34.     private $title null;
  35.     /**
  36.      * @ORM\Column(type="text", nullable=true)
  37.      */
  38.     private $content null;
  39.     /**
  40.      * @ORM\Column(type="integer", nullable=false)
  41.      */
  42.     private $position 0;
  43.     /**
  44.      * @ORM\Column(type="string", nullable=true, length=180)
  45.      */
  46.     private $meta_title null;
  47.     /**
  48.      * @ORM\Column(type="string", nullable=true, length=180)
  49.      */
  50.     private $meta_description null;
  51.     /**
  52.      * @ORM\Column(type="string", nullable=true, length=180)
  53.      */
  54.     private $meta_keywords null;
  55.     /**
  56.      * @ORM\Column(type="integer", nullable=false)
  57.      */
  58.     private $publication_status 0;
  59.     /**
  60.      * @ORM\Column(type="boolean", nullable=true)
  61.      */
  62.     private $show_in_footer;
  63.     /**
  64.      * @ORM\Column(type="boolean", nullable=true)
  65.      */
  66.     private $show_in_top_header;
  67.     /**
  68.      * @ORM\Column(type="string", nullable=true, length=60)
  69.      */
  70.     private $short_title null;
  71.     /**
  72.      * @ORM\Column(type="string", nullable=true, length=60)
  73.      */
  74.     private $icon_class;
  75.     /**
  76.      * @ORM\Column(type="string", nullable=true, length=20)
  77.      */
  78.     private $page_type;
  79.     public function getId(): ?int
  80.     {
  81.         return $this->id;
  82.     }
  83.     public function getSlug()
  84.     {
  85.         return $this->slug;
  86.     }
  87.     public function setSlug($slug)
  88.     {
  89.         $this->slug $slug;
  90.         return $this;
  91.     }
  92.     public function getTitle()
  93.     {
  94.         return $this->title;
  95.     }
  96.     public function setTitle($title)
  97.     {
  98.         $this->title $title;
  99.         return $this;
  100.     }
  101.     public function getContent()
  102.     {
  103.         return $this->content;
  104.     }
  105.     public function setContent($content)
  106.     {
  107.         $this->content $content;
  108.         return $this;
  109.     }
  110.     public function getPosition()
  111.     {
  112.         return $this->position;
  113.     }
  114.     public function setPosition($position)
  115.     {
  116.         $this->position $position;
  117.         return $this;
  118.     }
  119.     public function getMetaTitle()
  120.     {
  121.         return $this->meta_title;
  122.     }
  123.     public function setMetaTitle($meta_title)
  124.     {
  125.         $this->meta_title $meta_title;
  126.         return $this;
  127.     }
  128.     public function getMetaDescription()
  129.     {
  130.         return $this->meta_description;
  131.     }
  132.     public function setMetaDescription($meta_description)
  133.     {
  134.         $this->meta_description $meta_description;
  135.         return $this;
  136.     }
  137.     public function getMetaKeywords()
  138.     {
  139.         return $this->meta_keywords;
  140.     }
  141.     public function setMetaKeywords($meta_keywords)
  142.     {
  143.         $this->meta_keywords $meta_keywords;
  144.         return $this;
  145.     }
  146.     public function getPublicationStatus()
  147.     {
  148.         return $this->publication_status;
  149.     }
  150.     public function setPublicationStatus($publication_status)
  151.     {
  152.         $this->publication_status $publication_status;
  153.         return $this;
  154.     }
  155.     /**
  156.      * @ORM\Column(type="datetime", nullable=false)
  157.      */
  158.     private $created_at;
  159.     /**
  160.      * @ORM\Column(type="datetime", nullable=true)
  161.      */
  162.     private $updated_at null;
  163.     public function getCreatedAt(): \DateTimeInterface
  164.     {
  165.         return $this->created_at;
  166.     }
  167.     public function setCreatedAt(\DateTimeInterface $created_at): self
  168.     {
  169.         $this->created_at $created_at;
  170.         return $this;
  171.     }
  172.     public function getUpdatedAt(): ?\DateTimeInterface
  173.     {
  174.         return $this->updated_at;
  175.     }
  176.     public function setUpdatedAt(?\DateTimeInterface $updated_at): self
  177.     {
  178.         $this->updated_at $updated_at;
  179.         return $this;
  180.     }
  181.     /**
  182.      * @ORM\PrePersist
  183.      */
  184.     public function setCreatedAtValue()
  185.     {
  186.         $this->setCreatedAt(new \DateTime());
  187.     }
  188.     /**
  189.      * @ORM\PreUpdate
  190.      */
  191.     public function setUpdatedAtValue()
  192.     {
  193.         $this->setUpdatedAt(new \DateTime());
  194.     }
  195.     /**
  196.      * @ORM\Column(type="datetime", nullable=true)
  197.      */
  198.     private $deleted_at;
  199.     /**
  200.      * @ORM\OneToMany(targetEntity="App\Entity\ChannelMenu", mappedBy="page")
  201.      */
  202.     private $menus;
  203.     public function getDeletedAt(): ?\DateTimeInterface
  204.     {
  205.         return $this->deleted_at;
  206.     }
  207.     public function setDeletedAt(?\DateTimeInterface $deleted_at): self
  208.     {
  209.         $this->deleted_at $deleted_at;
  210.         return $this;
  211.     }
  212.     /**
  213.      * @return Collection|ChannelMenu[]
  214.      */
  215.     public function getMenus(): Collection
  216.     {
  217.         return $this->menus;
  218.     }
  219.     public function addMenu(ChannelMenu $menu): self
  220.     {
  221.         if (!$this->menus->contains($menu)) {
  222.             $this->menus[] = $menu;
  223.             $menu->setPage($this);
  224.         }
  225.         return $this;
  226.     }
  227.     public function removeMenu(ChannelMenu $menu): self
  228.     {
  229.         if ($this->menus->contains($menu)) {
  230.             $this->menus->removeElement($menu);
  231.             // set the owning side to null (unless already changed)
  232.             if ($menu->getPage() === $this) {
  233.                 $menu->setPage(null);
  234.             }
  235.         }
  236.         return $this;
  237.     }
  238.     // Target of a LinkedEntity from StaticPageController (Controller)
  239.     /**
  240.      * @ORM\OneToMany(targetEntity="App\Entity\StaticPageBlock", mappedBy="static_page")
  241.      */
  242.     private $static_page_blocks;
  243.     /**
  244.      * @return Collection|StaticPageBlock[]
  245.      */
  246.     public function getStaticPageBlocks(): Collection
  247.     {
  248.         return $this->static_page_blocks;
  249.     }
  250.     public function addStaticPageBlock(StaticPageBlock $static_page_block): self
  251.     {
  252.         if (!$this->static_page_blocks->contains($static_page_block)) {
  253.             $this->static_page_blocks[] = $static_page_block;
  254.             $static_page_block->setStaticPage($this);
  255.         }
  256.         return $this;
  257.     }
  258.     public function removeStaticPageBlock(StaticPageBlock $static_page_block): self
  259.     {
  260.         if ($this->static_page_blocks->contains($static_page_block)) {
  261.             $this->static_page_blocks->removeElement($static_page_block);
  262.             if ($static_page_block->getStaticPage() === $this) {
  263.                 $static_page_block->setStaticPage(null);
  264.             }
  265.         }
  266.         return $this;
  267.     }
  268.     /**
  269.      * @ORM\OneToMany(targetEntity="App\Entity\Channel", mappedBy="homepage")
  270.      */
  271.     private $channels_homepages;
  272.     /**
  273.      * @return Collection|Channel[]
  274.      */
  275.     public function getChannelHomepages(): Collection
  276.     {
  277.         return $this->channels_homepages;
  278.     }
  279.     public function addChannelHomepage(Channel $channel_homepage): self
  280.     {
  281.         if (!$this->channels_homepages->contains($channel_homepage)) {
  282.             $this->channels_homepages[] = $channel_homepage;
  283.             $channel_homepage->setHomepage($this);
  284.         }
  285.         return $this;
  286.     }
  287.     public function removeChannelHomepage(Channel $channel_homepage): self
  288.     {
  289.         if ($this->channels_homepages->contains($channel_homepage)) {
  290.             $this->channels_homepages->removeElement($channel_homepage);
  291.             if ($channel_homepage->getHomepage() === $this) {
  292.                 $channel_homepage->setHomepage(null);
  293.             }
  294.         }
  295.         return $this;
  296.     }
  297.     /**
  298.      * @return mixed
  299.      */
  300.     public function getShowInFooter()
  301.     {
  302.         return $this->show_in_footer;
  303.     }
  304.     /**
  305.      * @param mixed $show_in_footer
  306.      */
  307.     public function setShowInFooter($show_in_footer): void
  308.     {
  309.         $this->show_in_footer $show_in_footer;
  310.     }
  311.     /**
  312.      * @return mixed
  313.      */
  314.     public function getShowInTopHeader()
  315.     {
  316.         return $this->show_in_top_header;
  317.     }
  318.     /**
  319.      * @param mixed $show_in_top_header
  320.      */
  321.     public function setShowInTopHeader($show_in_top_header): void
  322.     {
  323.         $this->show_in_top_header $show_in_top_header;
  324.     }
  325.     /**
  326.      * @return null
  327.      */
  328.     public function getShortTitle(): ?string
  329.     {
  330.         return $this->short_title;
  331.     }
  332.     /**
  333.      * @param null $short_title
  334.      */
  335.     public function setShortTitle($short_title): void
  336.     {
  337.         $this->short_title $short_title;
  338.     }
  339.     /**
  340.      * @return mixed
  341.      */
  342.     public function getIconClass(): ?string
  343.     {
  344.         return $this->icon_class;
  345.     }
  346.     /**
  347.      * @param mixed $icon_class
  348.      */
  349.     public function setIconClass($icon_class): void
  350.     {
  351.         $this->icon_class $icon_class;
  352.     }
  353.     /**
  354.      * @return mixed
  355.      */
  356.     public function getPageType(): ?string
  357.     {
  358.         return $this->page_type;
  359.     }
  360.     /**
  361.      * @param mixed $page_type
  362.      */
  363.     public function setPageType($page_type): void
  364.     {
  365.         $this->page_type $page_type;
  366.     }
  367. }