src/Cms/SitebuilderBundle/Entity/Siteplan.php line 35

Open in your IDE?
  1. <?php
  2. namespace Cms\SitebuilderBundle\Entity;
  3. use Cms\CoreBundle\Model\EntityRestoreInterface;
  4. use Cms\CoreBundle\Model\EntityRestoreTrait;
  5. use Cms\CoreBundle\Model\Interfaces\Lockable\LockableInterface;
  6. use Cms\CoreBundle\Model\Interfaces\Lockable\LockableTrait;
  7. use Cms\TenantBundle\Entity\TenantedEntity;
  8. use Doctrine\ORM\Mapping as ORM;
  9. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  10. /**
  11.  * Class Siteplan
  12.  * @package Cms\SitebuilderBundle\Entity
  13.  *
  14.  * @ORM\Entity(
  15.  *     repositoryClass = "Cms\SitebuilderBundle\Doctrine\SiteplanRepository"
  16.  * )
  17.  * @ORM\HasLifecycleCallbacks
  18.  * @ORM\Table(
  19.  *     name = "cms__sitebuilder__siteplan",
  20.  *     uniqueConstraints = {
  21.  *         @ORM\UniqueConstraint(
  22.  *             name = "uidx__unique__siteplan",
  23.  *             columns = {
  24.  *                 "tenant",
  25.  *                 "name",
  26.  *             }
  27.  *         )
  28.  *     }
  29.  * )
  30.  * @UniqueEntity(fields="name", message="Sorry, this name is already in use.", groups={"unique_siteplan"})
  31.  */
  32. class Siteplan extends TenantedEntity implements LockableInterfaceEntityRestoreInterface
  33. {
  34.     use LockableTraitSiteplanRestoreTraitEntityRestoreTrait;
  35.     const LOCKABLE_TYPE 'siteplan';
  36.     /**
  37.      * @var string
  38.      *
  39.      * @ORM\Column(
  40.      *     type = "string",
  41.      *     nullable = false,
  42.      *     unique = false
  43.      * )
  44.      */
  45.     protected $name;
  46.     /**
  47.      * @var string
  48.      *
  49.      * @ORM\Column(
  50.      *     type = "text",
  51.      *     nullable = true
  52.      * )
  53.      */
  54.     protected $description;
  55.     /**
  56.      * @var bool
  57.      *
  58.      * @ORM\Column(
  59.      *     type = "boolean",
  60.      *     nullable = false,
  61.      *     options = {
  62.      *         "default" = false
  63.      *     }
  64.      * )
  65.      */
  66.     protected $allowPersonalSites false;
  67.     /**
  68.      * @return string
  69.      */
  70.     public function getName()
  71.     {
  72.         return $this->name;
  73.     }
  74.     /**
  75.      * @return string
  76.      */
  77.     public function getDescription()
  78.     {
  79.         return $this->description;
  80.     }
  81.     /**
  82.      * @param string $value
  83.      * @return $this
  84.      */
  85.     public function setName($value)
  86.     {
  87.         $this->name $value;
  88.         return $this;
  89.     }
  90.     /**
  91.      * @param string $value
  92.      * @return $this
  93.      */
  94.     public function setDescription($value)
  95.     {
  96.         $this->description $value;
  97.         return $this;
  98.     }
  99.     /**
  100.      * @return bool
  101.      */
  102.     public function getAllowPersonalSites()
  103.     {
  104.         return $this->allowPersonalSites;
  105.     }
  106.     /**
  107.      * @param bool $value
  108.      * @return $this
  109.      */
  110.     public function setAllowPersonalSites($value)
  111.     {
  112.         $this->allowPersonalSites = ($value === true);
  113.         return $this;
  114.     }
  115.     /**
  116.      * {@inheritdoc}
  117.      */
  118.     public function getLockName()
  119.     {
  120.         return $this->getName();
  121.     }
  122. }