vendor/sulu/redirect-bundle/Entity/RedirectRoute.php line 21

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of Sulu.
  4.  *
  5.  * (c) Sulu GmbH
  6.  *
  7.  * This source file is subject to the MIT license that is bundled
  8.  * with this source code in the file LICENSE.
  9.  */
  10. namespace Sulu\Bundle\RedirectBundle\Entity;
  11. use Sulu\Bundle\RedirectBundle\Model\RedirectRouteInterface;
  12. use Sulu\Component\Persistence\Model\AuditableInterface;
  13. use Sulu\Component\Persistence\Model\AuditableTrait;
  14. /**
  15.  * Basic implementation of redirect-route.
  16.  */
  17. class RedirectRoute implements RedirectRouteInterfaceAuditableInterface
  18. {
  19.     use AuditableTrait;
  20.     /**
  21.      * @var string
  22.      */
  23.     protected $id;
  24.     /**
  25.      * @var bool
  26.      */
  27.     protected $enabled true;
  28.     /**
  29.      * @var int
  30.      */
  31.     protected $statusCode 301;
  32.     /**
  33.      * @var string
  34.      */
  35.     protected $source;
  36.     /**
  37.      * @var string|null
  38.      */
  39.     protected $sourceHost;
  40.     /**
  41.      * @var string
  42.      */
  43.     protected $target;
  44.     /**
  45.      * {@inheritdoc}
  46.      */
  47.     public function getId()
  48.     {
  49.         return $this->id;
  50.     }
  51.     /**
  52.      * {@inheritdoc}
  53.      */
  54.     public function setId($id)
  55.     {
  56.         $this->id $id;
  57.         return $this;
  58.     }
  59.     /**
  60.      * {@inheritdoc}
  61.      */
  62.     public function isEnabled()
  63.     {
  64.         return $this->enabled;
  65.     }
  66.     /**
  67.      * {@inheritdoc}
  68.      */
  69.     public function setEnabled($enabled)
  70.     {
  71.         $this->enabled $enabled;
  72.         return $this;
  73.     }
  74.     /**
  75.      * {@inheritdoc}
  76.      */
  77.     public function getStatusCode()
  78.     {
  79.         return $this->statusCode;
  80.     }
  81.     /**
  82.      * {@inheritdoc}
  83.      */
  84.     public function setStatusCode($statusCode)
  85.     {
  86.         $this->statusCode $statusCode;
  87.         return $this;
  88.     }
  89.     /**
  90.      * {@inheritdoc}
  91.      */
  92.     public function getSource()
  93.     {
  94.         return $this->source;
  95.     }
  96.     /**
  97.      * {@inheritdoc}
  98.      */
  99.     public function setSource($source)
  100.     {
  101.         $this->source mb_strtolower('/' ltrim($source'/'));
  102.         return $this;
  103.     }
  104.     /**
  105.      * {@inheritdoc}
  106.      */
  107.     public function getSourceHost()
  108.     {
  109.         return $this->sourceHost;
  110.     }
  111.     /**
  112.      * {@inheritdoc}
  113.      */
  114.     public function setSourceHost($sourceHost)
  115.     {
  116.         $this->sourceHost = empty($sourceHost) ? null mb_strtolower($sourceHost);
  117.         return $this;
  118.     }
  119.     /**
  120.      * {@inheritdoc}
  121.      */
  122.     public function getTarget()
  123.     {
  124.         return $this->target;
  125.     }
  126.     /**
  127.      * {@inheritdoc}
  128.      */
  129.     public function setTarget($target)
  130.     {
  131.         $this->target $target;
  132.         return $this;
  133.     }
  134. }