<?php
namespace App\CmsBundle\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Symfony\Component\DependencyInjection\Loader\Configurator\Traits\PropertyTrait;
use Doctrine\ORM\Mapping as ORM;
use \DateTime;
/**
* StaticContent
*
* @ORM\Table(
* name="static_content",
* indexes={
* @ORM\Index(
* name="static_content_site_index",
* columns={"site_id"}
* ),
* @ORM\Index(
* name="static_content_type_index",
* columns={"type"}
* ),
* @ORM\Index(
* name="static_content_path_index",
* columns={"path"}
* ),
* @ORM\Index(
* name="static_content_position_index",
* columns={"position"}
* ),
* @ORM\Index(
* name="static_content_priority_index",
* columns={"priority"}
* ),
* @ORM\Index(
* name="static_content_select_index",
* columns={"site_id","path","type","published"}
* ),
* @ORM\Index(
* name="static_content_published_index",
* columns={"published"}
* )
* }
* )
* @ORM\Entity(repositoryClass="App\CmsBundle\Repository\StaticContentRepository")
* @ORM\HasLifecycleCallbacks()
*/
class StaticContent
{
use IdTrait, SiteTrait, TypeTrait, TitleTrait, AlternativeTitleTrait, ContentTrait, PathTrait, PositionTrait, PropertyTrait,
TimeStampedTrait, ParametersTrait, PriorityTrait, ClearCacheRequiredTrait, PublishedTrait;
protected const MODIFICATION_PROPERTIES = ['title', 'content'];
protected const SYNCHRONIZATION_PROPERTIES = ['position', 'parameters', 'type', 'path'];
/**
* @return string
*/
public function __toString(): string
{
return $this->getTitle();
}
/**
* @ORM\ManyToOne(targetEntity="App\CmsBundle\Entity\Site")
* @ORM\JoinColumn(name="site_id", referencedColumnName="id", nullable=true)
*/
private $site;
/**
* @ORM\ManyToOne(targetEntity="App\CmsBundle\Entity\Page", inversedBy="staticContents")
* @ORM\JoinColumn(name="page_id", referencedColumnName="id", nullable=true, onDelete="CASCADE")
*/
private $page;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $parameters;
/**
* @var integer
* @ORM\Column(name="priority", type="integer", nullable=false, options={"default" : 1})
*/
private $priority;
/**
* @var bool
* @ORM\Column(name="display_title", type="boolean", nullable=false, options={"default" : true})
*/
private bool $displayTitle;
/**
* @ORM\Column(name="publish_date", type="datetime", nullable=true, options={"default": "CURRENT_TIMESTAMP"})
*/
private ?DateTime $publishDate;
/**
* @var mixed
*/
private mixed $cdnImages;
/**
* @var string|null
* @ORM\Column(name="toc_alternative_title", type="string", length=255, nullable=true)
*/
private ?string $tocAlternativeTitle = null;
public function __construct()
{
}
/**
* @return string|null
*/
public function getTocAlternativeTitle(): ?string
{
return $this->tocAlternativeTitle;
}
/**
* @param string|null $tocAlternativeTitle
* @return $this
*/
public function setTocAlternativeTitle(?string $tocAlternativeTitle): self
{
$this->tocAlternativeTitle = $tocAlternativeTitle;
return $this;
}
/**
* @return mixed
*/
public function getCdnImages(): mixed
{
return $this->cdnImages;
}
/**
* @param ?mixed $cdnImages
* @return void
*/
public function setCdnImages(mixed $cdnImages): void
{
$this->cdnImages = $cdnImages;
}
/**
* @return ?DateTime
*/
public function getPublishDate(): ?DateTime
{
return $this->publishDate;
}
/**
* @param ?DateTime $publishDate
* @return $this
*/
public function setPublishDate(?DateTime $publishDate): self
{
$this->publishDate = $publishDate;
return $this;
}
/**
* @param Page|null $page
* @return $this
*/
public function setPage(?Page $page): self
{
$this->page = $page;
$this->setSite($page->getSite());
$this->setPath($page->getPath());
return $this;
}
/**
* @return Page|null
*/
public function getPage(): ?Page
{
return $this->page;
}
/**
* @return bool
*/
public function getDisplayTitle(): bool
{
return $this->displayTitle;
}
/**
* @param bool $displayTitle
* @return $this
*/
public function setDisplayTitle(bool $displayTitle): self
{
$this->displayTitle = $displayTitle;
return $this;
}
}