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 RedirectRouteInterface, AuditableInterface
  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. public function getId()
  45. {
  46. return $this->id;
  47. }
  48. public function setId($id)
  49. {
  50. $this->id = $id;
  51. return $this;
  52. }
  53. public function isEnabled()
  54. {
  55. return $this->enabled;
  56. }
  57. public function setEnabled($enabled)
  58. {
  59. $this->enabled = $enabled;
  60. return $this;
  61. }
  62. public function getStatusCode()
  63. {
  64. return $this->statusCode;
  65. }
  66. public function setStatusCode($statusCode)
  67. {
  68. $this->statusCode = $statusCode;
  69. return $this;
  70. }
  71. public function getSource()
  72. {
  73. return $this->source;
  74. }
  75. public function setSource($source)
  76. {
  77. $this->source = \mb_strtolower('/' . \ltrim($source, '/'));
  78. return $this;
  79. }
  80. public function getSourceHost()
  81. {
  82. return $this->sourceHost;
  83. }
  84. public function setSourceHost($sourceHost)
  85. {
  86. $this->sourceHost = empty($sourceHost) ? null : \mb_strtolower($sourceHost);
  87. return $this;
  88. }
  89. public function getTarget()
  90. {
  91. return $this->target;
  92. }
  93. public function setTarget($target)
  94. {
  95. $this->target = $target;
  96. return $this;
  97. }
  98. }