src/CoreBundle/Entity/Page.php line 15

Open in your IDE?
  1. <?php
  2. namespace Core\Entity;
  3. use Core\Entity\Traits\EntityTrait;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7.  * Page de l'application (Accueil, Contact, Mentions légales, ...)
  8.  *
  9.  * @ORM\Entity(repositoryClass="Core\Repository\PageRepository")
  10.  * @ORM\Table(name="core_page")
  11.  */
  12. class Page extends ControllerList
  13. {
  14.     use EntityTrait {
  15.         EntityTrait::__construct as private __entityConstruct;
  16.     }
  17.     /**
  18.      * Template twig de la page à utiliser
  19.      *
  20.      * @ORM\ManyToOne(targetEntity="PageTemplate", inversedBy="pages", fetch="EAGER")
  21.      * @ORM\JoinColumn(name="template_id", referencedColumnName="id", nullable=true)
  22.      */
  23.     private $template;
  24.     /**
  25.      * Description de la page
  26.      *
  27.      * @ORM\Column(type="text", nullable=true)
  28.      */
  29.     private $description;
  30.     /**
  31.      * @ORM\Column(type="boolean", nullable=true)
  32.      */
  33.     private $is_visible;
  34.     /**
  35.      * Nom de la page à utiliser
  36.      *
  37.      * @ORM\Column(type="string", length=255, nullable=true)
  38.      */
  39.     protected $controller_page;
  40.     /**
  41.      * Constructeur
  42.      * @throws \Exception
  43.      */
  44.     public function __construct()
  45.     {
  46.         parent::__construct();
  47.         $this->__entityConstruct();
  48.         $this->setIsVisible(true);
  49.     }
  50.     public function getTemplate()
  51.     {
  52.         return $this->template;
  53.     }
  54.     public function setTemplate($template)
  55.     {
  56.         $this->template $template;
  57.     }
  58.     /**
  59.      * @return mixed
  60.      */
  61.     public function getControllerPage()
  62.     {
  63.         return $this->controller_page;
  64.     }
  65.     /**
  66.      * @param mixed $controller_page
  67.      */
  68.     public function setControllerPage($controller_page): void
  69.     {
  70.         $this->controller_page $controller_page;
  71.     }
  72.     /**
  73.      * @return mixed
  74.      */
  75.     public function getIsVisible()
  76.     {
  77.         return $this->is_visible;
  78.     }
  79.     /**
  80.      * @param mixed $is_visible
  81.      */
  82.     public function setIsVisible($is_visible): void
  83.     {
  84.         $this->is_visible $is_visible;
  85.     }
  86.     /**
  87.      * @return mixed
  88.      */
  89.     public function getDescription()
  90.     {
  91.         return $this->description;
  92.     }
  93.     /**
  94.      * @param mixed $description
  95.      */
  96.     public function setDescription($description): void
  97.     {
  98.         $this->description $description;
  99.     }
  100.     public function __toString()
  101.     {
  102.         return (string)$this->getReference();
  103.     }
  104. }