<?php
namespace Cms\ThemeBundle\Entity;
use Cms\CoreBundle\Entity\HtmlOverrides;
use Cms\CoreBundle\Model\EntityRestoreInterface;
use Cms\CoreBundle\Model\EntityRestoreTrait;
use Cms\CoreBundle\Model\HtmlOverridableInterface;
use Cms\TenantBundle\Entity\TenantedEntity;
use Doctrine\ORM\Mapping as ORM;
/**
* Class InnerLayout
* @package Cms\ThemeBundle\Entity
*
* @ORM\Entity(
* repositoryClass = "Cms\ThemeBundle\Doctrine\InnerLayoutRepository"
* )
* @ORM\Table(
* "cms__theme__inner_layout",
* indexes={@ORM\Index(columns={"contents"}, flags={"fulltext"})}
* )
*/
class InnerLayout extends TenantedEntity implements HtmlOverridableInterface, EntityRestoreInterface
{
use InnerLayoutRestoreTrait;
use EntityRestoreTrait;
/**
* @var string
*
* @ORM\Column(
* type = "string",
* nullable = false
* )
*/
protected $name;
/**
* @var string
*
* @ORM\Column(
* type = "text",
* nullable = true
* )
*/
protected $description;
/**
* @var Template
*
* @ORM\ManyToOne(
* targetEntity = "Cms\ThemeBundle\Entity\Template",
* inversedBy = "innerLayouts"
* )
* @ORM\JoinColumn(
* name = "theme",
* referencedColumnName = "id",
* onDelete = "CASCADE",
* nullable = true
* )
*/
protected $theme = null;
/**
* @var HtmlOverrides
*
* @ORM\Embedded(
* class = "Cms\CoreBundle\Entity\HtmlOverrides",
* columnPrefix = "htmlOverrides_"
* )
*/
protected $htmlOverrides;
/**
* @var bool
*
* @ORM\Column(
* type = "boolean",
* nullable = false,
* options = {
* "default" : 0
* }
* )
*/
protected $intranet = false;
/**
* @inheritDoc
*/
public function __construct()
{
$this->htmlOverrides = new HtmlOverrides();
}
/**
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* @return string
*/
public function getDescription()
{
return $this->description;
}
/**
* @param string $value
* @return $this
*/
public function setName($value)
{
$this->name = $value;
return $this;
}
/**
* @param string $value
* @return $this
*/
public function setDescription($value)
{
$this->description = $value;
return $this;
}
/**
* @return Template
*/
public function getTheme()
{
return $this->theme;
}
/**
* @param Template $value
* @return $this
*/
public function setTheme(Template $value = null)
{
$this->theme = $value;
return $this;
}
/**
* @return Template
*/
public function getTemplate()
{
return $this->getTheme();
}
/**
* @param Template $value
* @return $this
*/
public function setTemplate(Template $value = null)
{
return $this->setTheme($value);
}
/**
* @return HtmlOverrides
*/
public function getHtmlOverrides()
{
return $this->htmlOverrides;
}
/**
* {@inheritdoc}
*/
public function getBodyClass()
{
return $this->getHtmlOverrides()->getBodyClass();
}
/**
* {@inheritdoc}
*/
public function getHeadScripts()
{
return $this->getHtmlOverrides()->getHeadScripts();
}
/**
* {@inheritdoc}
*/
public function getTopScripts()
{
return $this->getHtmlOverrides()->getTopScripts();
}
/**
* {@inheritdoc}
*/
public function getBottomScripts()
{
return $this->getHtmlOverrides()->getBottomScripts();
}
/**
* @return bool
*/
public function getIntranet()
{
return ($this->intranet === true);
}
/**
* @param bool $value
* @return $this
*/
public function setIntranet($value)
{
$this->intranet = ($value === true);
return $this;
}
}