<?php
namespace Cms\SitebuilderBundle\Entity;
use Cms\CoreBundle\Model\EntityRestoreInterface;
use Cms\CoreBundle\Model\EntityRestoreTrait;
use Cms\CoreBundle\Model\Interfaces\Lockable\LockableInterface;
use Cms\CoreBundle\Model\Interfaces\Lockable\LockableTrait;
use Cms\TenantBundle\Entity\TenantedEntity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
/**
* Class Siteplan
* @package Cms\SitebuilderBundle\Entity
*
* @ORM\Entity(
* repositoryClass = "Cms\SitebuilderBundle\Doctrine\SiteplanRepository"
* )
* @ORM\HasLifecycleCallbacks
* @ORM\Table(
* name = "cms__sitebuilder__siteplan",
* uniqueConstraints = {
* @ORM\UniqueConstraint(
* name = "uidx__unique__siteplan",
* columns = {
* "tenant",
* "name",
* }
* )
* }
* )
* @UniqueEntity(fields="name", message="Sorry, this name is already in use.", groups={"unique_siteplan"})
*/
class Siteplan extends TenantedEntity implements LockableInterface, EntityRestoreInterface
{
use LockableTrait, SiteplanRestoreTrait, EntityRestoreTrait;
const LOCKABLE_TYPE = 'siteplan';
/**
* @var string
*
* @ORM\Column(
* type = "string",
* nullable = false,
* unique = false
* )
*/
protected $name;
/**
* @var string
*
* @ORM\Column(
* type = "text",
* nullable = true
* )
*/
protected $description;
/**
* @var bool
*
* @ORM\Column(
* type = "boolean",
* nullable = false,
* options = {
* "default" = false
* }
* )
*/
protected $allowPersonalSites = false;
/**
* @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 bool
*/
public function getAllowPersonalSites()
{
return $this->allowPersonalSites;
}
/**
* @param bool $value
* @return $this
*/
public function setAllowPersonalSites($value)
{
$this->allowPersonalSites = ($value === true);
return $this;
}
/**
* {@inheritdoc}
*/
public function getLockName()
{
return $this->getName();
}
}