<?php
namespace Cms\ThemeBundle\Entity;
use Cms\CoreBundle\Model\EntityRestoreInterface;
use Cms\CoreBundle\Model\EntityRestoreTrait;
use Cms\TenantBundle\Entity\TenantedEntity;
use Cms\ThemeBundle\Model\ThemeOverridableInterface;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
/**
* Represents an instance of a theme inside the site.
*
* Class Template
* @package Cms\ThemeBundle\Entity
*
* @ORM\Entity(
* repositoryClass = "Cms\ThemeBundle\Doctrine\TemplateRepository"
* )
* @ORM\Table(
* name = "cms__theme__template"
* )
*/
class Template extends TenantedEntity implements ThemeOverridableInterface, EntityRestoreInterface
{
use EntityRestoreTrait;
use TemplateRestoreTrait;
/**
* The name of the theme that this template is based off of.
* This should be a theme that is defined in the committed source, otherwise problems will arise!
* TODO: fix the column name
*
* @var string
*
* @ORM\Column(
* name = "theme",
* type = "string",
* nullable = false
* )
*/
protected $package;
/**
* The name of the template in the system.
*
* @var string
*
* @ORM\Column(
* type = "string",
* nullable = false
* )
*/
protected $name;
/**
* @var array
*
* @ORM\Column(
* type = "json",
* nullable = true
* )
*/
protected $fonts = null;
/**
* @var OuterLayout
*
* @ORM\ManyToOne(
* targetEntity = "Cms\ThemeBundle\Entity\OuterLayout"
* )
* @ORM\JoinColumn(
* name = "outerLayout",
* referencedColumnName = "id",
* onDelete = "SET NULL"
* )
*/
protected $outerLayout;
/**
* @var InnerLayout
*
* @ORM\ManyToOne(
* targetEntity = "Cms\ThemeBundle\Entity\InnerLayout"
* )
* @ORM\JoinColumn(
* name = "innerLayout",
* referencedColumnName = "id",
* onDelete = "SET NULL"
* )
*/
protected $innerLayout;
/**
* @var ArrayCollection|InnerLayout[]
*
* @ORM\OneToMany(
* targetEntity = "Cms\ThemeBundle\Entity\InnerLayout",
* mappedBy = "theme"
* )
*/
protected $innerLayouts;
/**
* @var int
*
* @ORM\Column(
* type = "integer",
* nullable = false,
* options = {
* "default" = 0,
* "unsigned" = true,
* },
* )
*/
protected int $bust = 0;
/**
*
*/
public function __construct()
{
$this->innerLayouts = new ArrayCollection();
}
/**
* @return int
*/
public function getBust(): int
{
return $this->bust;
}
/**
* @param int $bust
* @return $this
*/
public function setBust(int $bust): self
{
$this->bust = $bust;
return $this;
}
/**
* @return ArrayCollection|InnerLayout[]
*/
public function getInnerLayouts()
{
return $this->innerLayouts;
}
/**
* @return InnerLayout
*/
public function getInnerLayout()
{
return $this->innerLayout;
}
/**
* @return OuterLayout
*/
public function getOuterLayout()
{
return $this->outerLayout;
}
/**
* @param InnerLayout $value
* @return $this
*/
public function setInnerLayout(InnerLayout $value = null)
{
$this->innerLayout = $value;
return $this;
}
/**
* @param OuterLayout $value
* @return $this
*/
public function setOuterLayout(OuterLayout $value = null)
{
$this->outerLayout = $value;
return $this;
}
/**
* {@inheritdoc}
*/
public function getThemeOverride()
{
return null;
}
/**
* {@inheritdoc}
*/
public function getOuterLayoutOverride()
{
return $this->getOuterLayout();
}
/**
* {@inheritdoc}
*/
public function getInnerLayoutOverride()
{
return $this->getInnerLayout();
}
/**
* @return string
*/
public function getPackage()
{
return $this->package;
}
/**
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* @return array
*/
public function getFonts()
{
return $this->fonts;
}
/**
* @param string $value
* @return $this
*/
public function setPackage($value)
{
$this->package = $value;
return $this;
}
/**
* @param string $value
* @return $this
*/
public function setName($value)
{
$this->name = $value;
return $this;
}
/**
* @param array $value
* @return $this
*/
public function setFonts(array $value = null)
{
$this->fonts = $value;
return $this;
}
}