src/Cms/ThemeBundle/Entity/InnerLayout.php line 23

Open in your IDE?
  1. <?php
  2. namespace Cms\ThemeBundle\Entity;
  3. use Cms\CoreBundle\Entity\HtmlOverrides;
  4. use Cms\CoreBundle\Model\EntityRestoreInterface;
  5. use Cms\CoreBundle\Model\EntityRestoreTrait;
  6. use Cms\CoreBundle\Model\HtmlOverridableInterface;
  7. use Cms\TenantBundle\Entity\TenantedEntity;
  8. use Doctrine\ORM\Mapping as ORM;
  9. /**
  10.  * Class InnerLayout
  11.  * @package Cms\ThemeBundle\Entity
  12.  *
  13.  * @ORM\Entity(
  14.  *  repositoryClass = "Cms\ThemeBundle\Doctrine\InnerLayoutRepository"
  15.  * )
  16.  * @ORM\Table(
  17.  *  "cms__theme__inner_layout"
  18.  * )
  19.  */
  20. class InnerLayout extends TenantedEntity implements HtmlOverridableInterfaceEntityRestoreInterface
  21. {
  22.     use InnerLayoutRestoreTrait;
  23.     use EntityRestoreTrait;
  24.     /**
  25.      * @var string
  26.      *
  27.      * @ORM\Column(
  28.      *  type = "string",
  29.      *  nullable = false
  30.      * )
  31.      */
  32.     protected $name;
  33.     /**
  34.      * @var string
  35.      *
  36.      * @ORM\Column(
  37.      *  type = "text",
  38.      *  nullable = true
  39.      * )
  40.      */
  41.     protected $description;
  42.     /**
  43.      * @var Template
  44.      *
  45.      * @ORM\ManyToOne(
  46.      *     targetEntity = "Cms\ThemeBundle\Entity\Template",
  47.      *     inversedBy = "innerLayouts"
  48.      * )
  49.      * @ORM\JoinColumn(
  50.      *     name = "theme",
  51.      *     referencedColumnName = "id",
  52.      *     onDelete = "CASCADE",
  53.      *     nullable = true
  54.      * )
  55.      */
  56.     protected $theme null;
  57.     /**
  58.      * @var HtmlOverrides
  59.      *
  60.      * @ORM\Embedded(
  61.      *     class = "Cms\CoreBundle\Entity\HtmlOverrides",
  62.      *     columnPrefix = "htmlOverrides_"
  63.      * )
  64.      */
  65.     protected $htmlOverrides;
  66.     /**
  67.      * @var bool
  68.      *
  69.      * @ORM\Column(
  70.      *     type = "boolean",
  71.      *     nullable = false,
  72.      *     options = {
  73.      *         "default" : 0
  74.      *     }
  75.      * )
  76.      */
  77.     protected $intranet false;
  78.     /**
  79.      * @inheritDoc
  80.      */
  81.     public function __construct()
  82.     {
  83.         $this->htmlOverrides = new HtmlOverrides();
  84.     }
  85.     /**
  86.      * @return string
  87.      */
  88.     public function getName()
  89.     {
  90.         return $this->name;
  91.     }
  92.     /**
  93.      * @return string
  94.      */
  95.     public function getDescription()
  96.     {
  97.         return $this->description;
  98.     }
  99.     /**
  100.      * @param string $value
  101.      * @return $this
  102.      */
  103.     public function setName($value)
  104.     {
  105.         $this->name $value;
  106.         return $this;
  107.     }
  108.     /**
  109.      * @param string $value
  110.      * @return $this
  111.      */
  112.     public function setDescription($value)
  113.     {
  114.         $this->description $value;
  115.         return $this;
  116.     }
  117.     /**
  118.      * @return Template
  119.      */
  120.     public function getTheme()
  121.     {
  122.         return $this->theme;
  123.     }
  124.     /**
  125.      * @param Template $value
  126.      * @return $this
  127.      */
  128.     public function setTheme(Template $value null)
  129.     {
  130.         $this->theme $value;
  131.         return $this;
  132.     }
  133.     /**
  134.      * @return Template
  135.      */
  136.     public function getTemplate()
  137.     {
  138.         return $this->getTheme();
  139.     }
  140.     /**
  141.      * @param Template $value
  142.      * @return $this
  143.      */
  144.     public function setTemplate(Template $value null)
  145.     {
  146.         return $this->setTheme($value);
  147.     }
  148.     /**
  149.      * @return HtmlOverrides
  150.      */
  151.     public function getHtmlOverrides()
  152.     {
  153.         return $this->htmlOverrides;
  154.     }
  155.     /**
  156.      * {@inheritdoc}
  157.      */
  158.     public function getBodyClass()
  159.     {
  160.         return $this->getHtmlOverrides()->getBodyClass();
  161.     }
  162.     /**
  163.      * {@inheritdoc}
  164.      */
  165.     public function getHeadScripts()
  166.     {
  167.         return $this->getHtmlOverrides()->getHeadScripts();
  168.     }
  169.     /**
  170.      * {@inheritdoc}
  171.      */
  172.     public function getTopScripts()
  173.     {
  174.         return $this->getHtmlOverrides()->getTopScripts();
  175.     }
  176.     /**
  177.      * {@inheritdoc}
  178.      */
  179.     public function getBottomScripts()
  180.     {
  181.         return $this->getHtmlOverrides()->getBottomScripts();
  182.     }
  183.     /**
  184.      * @return bool
  185.      */
  186.     public function getIntranet()
  187.     {
  188.         return ($this->intranet === true);
  189.     }
  190.     /**
  191.      * @param bool $value
  192.      * @return $this
  193.      */
  194.     public function setIntranet($value)
  195.     {
  196.         $this->intranet = ($value === true);
  197.         return $this;
  198.     }
  199. }