AbstractPlugin.php 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. <?php
  2. /**
  3. *
  4. * Cube Framework $Id$ XF6yaJAY5BbugtNtslRvMxyP/1E9HOQA//636FLxqVw=
  5. *
  6. * @link http://codecu.be/framework
  7. * @copyright Copyright (c) 2014 CodeCube SRL
  8. * @license http://codecu.be/framework/license Commercial License
  9. *
  10. * @version 1.0
  11. */
  12. /**
  13. * controller plugins abstract class
  14. */
  15. namespace Cube\Controller\Plugin;
  16. use Cube\Controller\Request\AbstractRequest,
  17. Cube\Controller\Response\AbstractResponse;
  18. class AbstractPlugin
  19. {
  20. /**
  21. *
  22. * request object
  23. *
  24. * @var \Cube\Controller\Request\AbstractRequest
  25. */
  26. protected $_request;
  27. /**
  28. *
  29. * @var \Cube\Controller\Response\AbstractResponse
  30. */
  31. protected $_response;
  32. /**
  33. *
  34. * get request object
  35. *
  36. * @return \Cube\Controller\Request\AbstractRequest
  37. */
  38. public function getRequest()
  39. {
  40. return $this->_request;
  41. }
  42. /**
  43. *
  44. * set request object
  45. *
  46. * @param \Cube\Controller\Request\AbstractRequest $request
  47. *
  48. * @return \Cube\Controller\Plugin\AbstractPlugin
  49. */
  50. public function setRequest(AbstractRequest $request)
  51. {
  52. $this->_request = $request;
  53. return $this;
  54. }
  55. /**
  56. *
  57. * get response object
  58. *
  59. * @return \Cube\Controller\Response\AbstractResponse
  60. */
  61. public function getResponse()
  62. {
  63. return $this->_response;
  64. }
  65. /**
  66. *
  67. * set response object
  68. *
  69. * @param \Cube\Controller\Response\AbstractResponse $response
  70. *
  71. * @return \Cube\Controller\Plugin\AbstractPlugin
  72. */
  73. public function setResponse(AbstractResponse $response)
  74. {
  75. $this->_response = $response;
  76. return $this;
  77. }
  78. /**
  79. *
  80. * this method will be run prior to routing the request
  81. */
  82. public function preRoute()
  83. {
  84. }
  85. /**
  86. *
  87. * this method will be run after the request has been routed
  88. */
  89. public function postRoute()
  90. {
  91. }
  92. /**
  93. *
  94. * this method will be run before starting the dispatch loop
  95. */
  96. public function preDispatcher()
  97. {
  98. }
  99. /**
  100. *
  101. * this method will be run after the dispatch loop has ended
  102. */
  103. public function postDispatcher()
  104. {
  105. }
  106. /**
  107. *
  108. * this method will be run each time an action is dispatched
  109. */
  110. public function preDispatch()
  111. {
  112. }
  113. /**
  114. *
  115. * this method will be run after an action has been dispatched
  116. */
  117. public function postDispatch()
  118. {
  119. }
  120. }