lib/boab/cms-bundle/src/Entity/PageRoute.php line 14

Open in your IDE?
  1. <?php
  2. namespace Boab\CmsBundle\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Boab\CmsBundle\Entity\Route;
  5. /**
  6.  * PageRoute
  7.  *
  8.  * @ORM\Entity
  9.  * @ORM\Entity(repositoryClass="Boab\CmsBundle\Repository\RouteRepository")
  10.  */
  11. class PageRoute extends Route implements RouteContentInterface
  12. {
  13.     const DEFAULT_CONTROLLER 'content_controller::showAction';
  14.     const CONTENT_TYPE 'page';
  15.     public function getController()
  16.     {
  17.         return self::DEFAULT_CONTROLLER;
  18.     }
  19.     public function getContentTypeId()
  20.     {
  21.         return self::CONTENT_TYPE;
  22.     }
  23.     /**
  24.      * Get contentType
  25.      *
  26.      * @return string
  27.      */
  28.     public function getContentType():?string
  29.     {
  30.         return self::CONTENT_TYPE;
  31.     }
  32.     public function setDefaults( array $defauts=[]): static
  33.     {
  34.         $defauts = [
  35.             '_title' => $this->getTitle(),
  36.             '_controller' => $this->getController(),
  37.             '_template'=>$this->getTemplate(),
  38.         ];
  39.         return $this->addDefaults($defauts);
  40.     }
  41. }