src/Cms/ThemeBundle/Entity/Template.php line 25

Open in your IDE?
  1. <?php
  2. namespace Cms\ThemeBundle\Entity;
  3. use Cms\CoreBundle\Model\EntityRestoreInterface;
  4. use Cms\CoreBundle\Model\EntityRestoreTrait;
  5. use Cms\TenantBundle\Entity\TenantedEntity;
  6. use Cms\ThemeBundle\Model\ThemeOverridableInterface;
  7. use Doctrine\Common\Collections\ArrayCollection;
  8. use Doctrine\ORM\Mapping as ORM;
  9. /**
  10.  * Represents an instance of a theme inside the site.
  11.  *
  12.  * Class Template
  13.  * @package Cms\ThemeBundle\Entity
  14.  *
  15.  * @ORM\Entity(
  16.  *  repositoryClass = "Cms\ThemeBundle\Doctrine\TemplateRepository"
  17.  * )
  18.  * @ORM\Table(
  19.  *  name = "cms__theme__template"
  20.  * )
  21.  */
  22. class Template extends TenantedEntity implements ThemeOverridableInterfaceEntityRestoreInterface
  23. {
  24.     use EntityRestoreTrait;
  25.     use TemplateRestoreTrait;
  26.     /**
  27.      * The name of the theme that this template is based off of.
  28.      * This should be a theme that is defined in the committed source, otherwise problems will arise!
  29.      * TODO: fix the column name
  30.      *
  31.      * @var string
  32.      *
  33.      * @ORM\Column(
  34.      *  name = "theme",
  35.      *  type = "string",
  36.      *  nullable = false
  37.      * )
  38.      */
  39.     protected $package;
  40.     /**
  41.      * The name of the template in the system.
  42.      *
  43.      * @var string
  44.      *
  45.      * @ORM\Column(
  46.      *  type = "string",
  47.      *  nullable = false
  48.      * )
  49.      */
  50.     protected $name;
  51.     /**
  52.      * @var array
  53.      *
  54.      * @ORM\Column(
  55.      *  type = "json",
  56.      *  nullable = true
  57.      * )
  58.      */
  59.     protected $fonts null;
  60.     /**
  61.      * @var OuterLayout
  62.      *
  63.      * @ORM\ManyToOne(
  64.      *     targetEntity = "Cms\ThemeBundle\Entity\OuterLayout"
  65.      * )
  66.      * @ORM\JoinColumn(
  67.      *     name = "outerLayout",
  68.      *     referencedColumnName = "id",
  69.      *     onDelete = "SET NULL"
  70.      * )
  71.      */
  72.     protected $outerLayout;
  73.     /**
  74.      * @var InnerLayout
  75.      *
  76.      * @ORM\ManyToOne(
  77.      *     targetEntity = "Cms\ThemeBundle\Entity\InnerLayout"
  78.      * )
  79.      * @ORM\JoinColumn(
  80.      *     name = "innerLayout",
  81.      *     referencedColumnName = "id",
  82.      *     onDelete = "SET NULL"
  83.      * )
  84.      */
  85.     protected $innerLayout;
  86.     /**
  87.      * @var ArrayCollection|InnerLayout[]
  88.      *
  89.      * @ORM\OneToMany(
  90.      *     targetEntity = "Cms\ThemeBundle\Entity\InnerLayout",
  91.      *     mappedBy = "theme"
  92.      * )
  93.      */
  94.     protected $innerLayouts;
  95.     /**
  96.      * @var int
  97.      *
  98.      * @ORM\Column(
  99.      *     type = "integer",
  100.      *     nullable = false,
  101.      *     options = {
  102.      *         "default" = 0,
  103.      *         "unsigned" = true,
  104.      *     },
  105.      * )
  106.      */
  107.     protected int $bust 0;
  108.     /**
  109.      *
  110.      */
  111.     public function __construct()
  112.     {
  113.         $this->innerLayouts = new ArrayCollection();
  114.     }
  115.     /**
  116.      * @return int
  117.      */
  118.     public function getBust(): int
  119.     {
  120.         return $this->bust;
  121.     }
  122.     /**
  123.      * @param int $bust
  124.      * @return $this
  125.      */
  126.     public function setBust(int $bust): self
  127.     {
  128.         $this->bust $bust;
  129.         return $this;
  130.     }
  131.     /**
  132.      * @return ArrayCollection|InnerLayout[]
  133.      */
  134.     public function getInnerLayouts()
  135.     {
  136.         return $this->innerLayouts;
  137.     }
  138.     /**
  139.      * @return InnerLayout
  140.      */
  141.     public function getInnerLayout()
  142.     {
  143.         return $this->innerLayout;
  144.     }
  145.     /**
  146.      * @return OuterLayout
  147.      */
  148.     public function getOuterLayout()
  149.     {
  150.         return $this->outerLayout;
  151.     }
  152.     /**
  153.      * @param InnerLayout $value
  154.      * @return $this
  155.      */
  156.     public function setInnerLayout(InnerLayout $value null)
  157.     {
  158.         $this->innerLayout $value;
  159.         return $this;
  160.     }
  161.     /**
  162.      * @param OuterLayout $value
  163.      * @return $this
  164.      */
  165.     public function setOuterLayout(OuterLayout $value null)
  166.     {
  167.         $this->outerLayout $value;
  168.         return $this;
  169.     }
  170.     /**
  171.      * {@inheritdoc}
  172.      */
  173.     public function getThemeOverride()
  174.     {
  175.         return null;
  176.     }
  177.     /**
  178.      * {@inheritdoc}
  179.      */
  180.     public function getOuterLayoutOverride()
  181.     {
  182.         return $this->getOuterLayout();
  183.     }
  184.     /**
  185.      * {@inheritdoc}
  186.      */
  187.     public function getInnerLayoutOverride()
  188.     {
  189.         return $this->getInnerLayout();
  190.     }
  191.     /**
  192.      * @return string
  193.      */
  194.     public function getPackage()
  195.     {
  196.         return $this->package;
  197.     }
  198.     /**
  199.      * @return string
  200.      */
  201.     public function getName()
  202.     {
  203.         return $this->name;
  204.     }
  205.     /**
  206.      * @return array
  207.      */
  208.     public function getFonts()
  209.     {
  210.         return $this->fonts;
  211.     }
  212.     /**
  213.      * @param string $value
  214.      * @return $this
  215.      */
  216.     public function setPackage($value)
  217.     {
  218.         $this->package $value;
  219.         return $this;
  220.     }
  221.     /**
  222.      * @param string $value
  223.      * @return $this
  224.      */
  225.     public function setName($value)
  226.     {
  227.         $this->name $value;
  228.         return $this;
  229.     }
  230.     /**
  231.      * @param array $value
  232.      * @return $this
  233.      */
  234.     public function setFonts(array $value null)
  235.     {
  236.         $this->fonts $value;
  237.         return $this;
  238.     }
  239. }