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

Open in your IDE?
  1. <?php
  2. namespace Boab\CmsBundle\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Symfony\Component\Validator\Constraints as Assert;
  5. /**
  6.  * UrlRoute
  7.  *
  8.  * @ORM\Table(name="route_url")
  9.  * @ORM\Entity(repositoryClass="Boab\CmsBundle\Repository\RouteRepository")
  10.  */
  11. class UrlRoute extends Route
  12. {
  13.     /**
  14.      * @var string
  15.      *
  16.      * @ORM\Column(name="url", type="string", length=255, precision=0, scale=0, nullable=false, unique=false)
  17.      * @Assert\Url(
  18.      *    message = "The url '{{ value }}' is not a valid url",
  19.      * )
  20.      */
  21.     private $url;
  22.     private $contentType;
  23.     /**
  24.      * @var string
  25.      *
  26.      * @ORM\Column(name="permanent", type="boolean", nullable=true)
  27.      */
  28.     private $permanent;
  29.     public function getController()
  30.     {
  31.         return 'Symfony\Bundle\FrameworkBundle\Controller\RedirectController::urlRedirectAction';
  32.     }
  33.     public function setController()
  34.     {
  35.     }
  36.     public function getContentType():?string
  37.     {
  38.         return '';
  39.     }
  40.     public function setContentType()
  41.     {
  42.     }
  43.     public function setDefaults( array $defauts=[]): static
  44.     {
  45.         $defauts = [
  46.             '_controller' => $this->getController(),
  47.             '_title' => $this->getTitle(),
  48.             '_template'=> $this->getTemplate(),
  49.             'path'=> $this->getUrl(),
  50.             'permanent'=> $this->getPermanent(),
  51.         ];
  52.         return parent::setDefaults($defauts);
  53.     }
  54.     /**
  55.      * Get the value of url
  56.      */
  57.     public function getUrl()
  58.     {
  59.         return $this->url;
  60.     }
  61.     /**
  62.      * Set the value of url
  63.      *
  64.      * @return  self
  65.      */
  66.     public function setUrl($url)
  67.     {
  68.         $this->url $url;
  69.         return $this;
  70.     }
  71.     /**
  72.      * Get the value of permanent
  73.      */
  74.     public function getPermanent()
  75.     {
  76.         return $this->permanent;
  77.     }
  78.     /**
  79.      * Set the value of permanent
  80.      *
  81.      * @return  self
  82.      */
  83.     public function setPermanent($permanent)
  84.     {
  85.         $this->permanent $permanent;
  86.         return $this;
  87.     }
  88. }