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

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