<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass="App\Repository\StaticPageRepository")
*
* @ORM\HasLifecycleCallbacks()
*/
class StaticPage
{
public function __construct()
{
$this->menus = new ArrayCollection();
$this->static_page_blocks = new ArrayCollection();
$this->channels_homepages = new ArrayCollection();
}
/**
* @ORM\Id()
*
* @ORM\GeneratedValue()
*
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", nullable=false, length=180)
*/
private $slug = null;
/**
* @ORM\Column(type="string", nullable=false, length=180)
*/
private $title = null;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $content = null;
/**
* @ORM\Column(type="integer", nullable=false)
*/
private $position = 0;
/**
* @ORM\Column(type="string", nullable=true, length=180)
*/
private $meta_title = null;
/**
* @ORM\Column(type="string", nullable=true, length=180)
*/
private $meta_description = null;
/**
* @ORM\Column(type="string", nullable=true, length=180)
*/
private $meta_keywords = null;
/**
* @ORM\Column(type="integer", nullable=false)
*/
private $publication_status = 0;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $show_in_footer;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $show_in_top_header;
/**
* @ORM\Column(type="string", nullable=true, length=60)
*/
private $short_title = null;
/**
* @ORM\Column(type="string", nullable=true, length=60)
*/
private $icon_class;
/**
* @ORM\Column(type="string", nullable=true, length=20)
*/
private $page_type;
public function getId(): ?int
{
return $this->id;
}
public function getSlug()
{
return $this->slug;
}
public function setSlug($slug)
{
$this->slug = $slug;
return $this;
}
public function getTitle()
{
return $this->title;
}
public function setTitle($title)
{
$this->title = $title;
return $this;
}
public function getContent()
{
return $this->content;
}
public function setContent($content)
{
$this->content = $content;
return $this;
}
public function getPosition()
{
return $this->position;
}
public function setPosition($position)
{
$this->position = $position;
return $this;
}
public function getMetaTitle()
{
return $this->meta_title;
}
public function setMetaTitle($meta_title)
{
$this->meta_title = $meta_title;
return $this;
}
public function getMetaDescription()
{
return $this->meta_description;
}
public function setMetaDescription($meta_description)
{
$this->meta_description = $meta_description;
return $this;
}
public function getMetaKeywords()
{
return $this->meta_keywords;
}
public function setMetaKeywords($meta_keywords)
{
$this->meta_keywords = $meta_keywords;
return $this;
}
public function getPublicationStatus()
{
return $this->publication_status;
}
public function setPublicationStatus($publication_status)
{
$this->publication_status = $publication_status;
return $this;
}
/**
* @ORM\Column(type="datetime", nullable=false)
*/
private $created_at;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $updated_at = null;
public function getCreatedAt(): \DateTimeInterface
{
return $this->created_at;
}
public function setCreatedAt(\DateTimeInterface $created_at): self
{
$this->created_at = $created_at;
return $this;
}
public function getUpdatedAt(): ?\DateTimeInterface
{
return $this->updated_at;
}
public function setUpdatedAt(?\DateTimeInterface $updated_at): self
{
$this->updated_at = $updated_at;
return $this;
}
/**
* @ORM\PrePersist
*/
public function setCreatedAtValue()
{
$this->setCreatedAt(new \DateTime());
}
/**
* @ORM\PreUpdate
*/
public function setUpdatedAtValue()
{
$this->setUpdatedAt(new \DateTime());
}
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $deleted_at;
/**
* @ORM\OneToMany(targetEntity="App\Entity\ChannelMenu", mappedBy="page")
*/
private $menus;
public function getDeletedAt(): ?\DateTimeInterface
{
return $this->deleted_at;
}
public function setDeletedAt(?\DateTimeInterface $deleted_at): self
{
$this->deleted_at = $deleted_at;
return $this;
}
/**
* @return Collection|ChannelMenu[]
*/
public function getMenus(): Collection
{
return $this->menus;
}
public function addMenu(ChannelMenu $menu): self
{
if (!$this->menus->contains($menu)) {
$this->menus[] = $menu;
$menu->setPage($this);
}
return $this;
}
public function removeMenu(ChannelMenu $menu): self
{
if ($this->menus->contains($menu)) {
$this->menus->removeElement($menu);
// set the owning side to null (unless already changed)
if ($menu->getPage() === $this) {
$menu->setPage(null);
}
}
return $this;
}
// Target of a LinkedEntity from StaticPageController (Controller)
/**
* @ORM\OneToMany(targetEntity="App\Entity\StaticPageBlock", mappedBy="static_page")
*/
private $static_page_blocks;
/**
* @return Collection|StaticPageBlock[]
*/
public function getStaticPageBlocks(): Collection
{
return $this->static_page_blocks;
}
public function addStaticPageBlock(StaticPageBlock $static_page_block): self
{
if (!$this->static_page_blocks->contains($static_page_block)) {
$this->static_page_blocks[] = $static_page_block;
$static_page_block->setStaticPage($this);
}
return $this;
}
public function removeStaticPageBlock(StaticPageBlock $static_page_block): self
{
if ($this->static_page_blocks->contains($static_page_block)) {
$this->static_page_blocks->removeElement($static_page_block);
if ($static_page_block->getStaticPage() === $this) {
$static_page_block->setStaticPage(null);
}
}
return $this;
}
/**
* @ORM\OneToMany(targetEntity="App\Entity\Channel", mappedBy="homepage")
*/
private $channels_homepages;
/**
* @return Collection|Channel[]
*/
public function getChannelHomepages(): Collection
{
return $this->channels_homepages;
}
public function addChannelHomepage(Channel $channel_homepage): self
{
if (!$this->channels_homepages->contains($channel_homepage)) {
$this->channels_homepages[] = $channel_homepage;
$channel_homepage->setHomepage($this);
}
return $this;
}
public function removeChannelHomepage(Channel $channel_homepage): self
{
if ($this->channels_homepages->contains($channel_homepage)) {
$this->channels_homepages->removeElement($channel_homepage);
if ($channel_homepage->getHomepage() === $this) {
$channel_homepage->setHomepage(null);
}
}
return $this;
}
/**
* @return mixed
*/
public function getShowInFooter()
{
return $this->show_in_footer;
}
/**
* @param mixed $show_in_footer
*/
public function setShowInFooter($show_in_footer): void
{
$this->show_in_footer = $show_in_footer;
}
/**
* @return mixed
*/
public function getShowInTopHeader()
{
return $this->show_in_top_header;
}
/**
* @param mixed $show_in_top_header
*/
public function setShowInTopHeader($show_in_top_header): void
{
$this->show_in_top_header = $show_in_top_header;
}
/**
* @return null
*/
public function getShortTitle(): ?string
{
return $this->short_title;
}
/**
* @param null $short_title
*/
public function setShortTitle($short_title): void
{
$this->short_title = $short_title;
}
/**
* @return mixed
*/
public function getIconClass(): ?string
{
return $this->icon_class;
}
/**
* @param mixed $icon_class
*/
public function setIconClass($icon_class): void
{
$this->icon_class = $icon_class;
}
/**
* @return mixed
*/
public function getPageType(): ?string
{
return $this->page_type;
}
/**
* @param mixed $page_type
*/
public function setPageType($page_type): void
{
$this->page_type = $page_type;
}
}