Context.php 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Framework\App\Action;
  7. use Magento\Framework\Controller\ResultFactory;
  8. /**
  9. * Constructor modification point for Magento\Framework\App\Action.
  10. *
  11. * All context classes were introduced to allow for backwards compatible constructor modifications
  12. * of classes that were supposed to be extended by extension developers.
  13. *
  14. * Do not call methods of this class directly.
  15. *
  16. * As Magento moves from inheritance-based APIs all such classes will be deprecated together with
  17. * the classes they were introduced for.
  18. *
  19. * @api
  20. * @since 100.0.2
  21. */
  22. class Context implements \Magento\Framework\ObjectManager\ContextInterface
  23. {
  24. /**
  25. * @var \Magento\Framework\App\RequestInterface
  26. */
  27. protected $_request;
  28. /**
  29. * @var \Magento\Framework\App\ResponseInterface
  30. */
  31. protected $_response;
  32. /**
  33. * @var \Magento\Framework\ObjectManagerInterface
  34. */
  35. protected $_objectManager;
  36. /**
  37. * @var \Magento\Framework\Event\ManagerInterface
  38. */
  39. protected $_eventManager;
  40. /**
  41. * @var \Magento\Framework\UrlInterface
  42. */
  43. protected $_url;
  44. /**
  45. * @var \Magento\Framework\App\Response\RedirectInterface
  46. */
  47. protected $_redirect;
  48. /**
  49. * @var \Magento\Framework\App\ActionFlag
  50. */
  51. protected $_actionFlag;
  52. /**
  53. * @var \Magento\Framework\App\ViewInterface
  54. */
  55. protected $_view;
  56. /**
  57. * @var \Magento\Framework\Message\ManagerInterface
  58. */
  59. protected $messageManager;
  60. /**
  61. * @var \Magento\Framework\Controller\Result\RedirectFactory
  62. */
  63. protected $resultRedirectFactory;
  64. /**
  65. * @var \Magento\Framework\Controller\ResultFactory
  66. */
  67. protected $resultFactory;
  68. /**
  69. * @param \Magento\Framework\App\RequestInterface $request
  70. * @param \Magento\Framework\App\ResponseInterface $response
  71. * @param \Magento\Framework\ObjectManagerInterface $objectManager
  72. * @param \Magento\Framework\Event\ManagerInterface $eventManager
  73. * @param \Magento\Framework\UrlInterface $url
  74. * @param \Magento\Framework\App\Response\RedirectInterface $redirect
  75. * @param \Magento\Framework\App\ActionFlag $actionFlag
  76. * @param \Magento\Framework\App\ViewInterface $view
  77. * @param \Magento\Framework\Message\ManagerInterface $messageManager
  78. * @param \Magento\Framework\Controller\Result\RedirectFactory $resultRedirectFactory
  79. * @param \Magento\Framework\Controller\ResultFactory $resultFactory
  80. *
  81. * @SuppressWarnings(PHPMD.ExcessiveParameterList)
  82. */
  83. public function __construct(
  84. \Magento\Framework\App\RequestInterface $request,
  85. \Magento\Framework\App\ResponseInterface $response,
  86. \Magento\Framework\ObjectManagerInterface $objectManager,
  87. \Magento\Framework\Event\ManagerInterface $eventManager,
  88. \Magento\Framework\UrlInterface $url,
  89. \Magento\Framework\App\Response\RedirectInterface $redirect,
  90. \Magento\Framework\App\ActionFlag $actionFlag,
  91. \Magento\Framework\App\ViewInterface $view,
  92. \Magento\Framework\Message\ManagerInterface $messageManager,
  93. \Magento\Framework\Controller\Result\RedirectFactory $resultRedirectFactory,
  94. ResultFactory $resultFactory
  95. ) {
  96. $this->_request = $request;
  97. $this->_response = $response;
  98. $this->_objectManager = $objectManager;
  99. $this->_eventManager = $eventManager;
  100. $this->_url = $url;
  101. $this->_redirect = $redirect;
  102. $this->_actionFlag = $actionFlag;
  103. $this->_view = $view;
  104. $this->messageManager = $messageManager;
  105. $this->resultRedirectFactory = $resultRedirectFactory;
  106. $this->resultFactory = $resultFactory;
  107. }
  108. /**
  109. * @return \Magento\Framework\App\ActionFlag
  110. */
  111. public function getActionFlag()
  112. {
  113. return $this->_actionFlag;
  114. }
  115. /**
  116. * @return \Magento\Framework\Event\ManagerInterface
  117. */
  118. public function getEventManager()
  119. {
  120. return $this->_eventManager;
  121. }
  122. /**
  123. * @return \Magento\Framework\App\ViewInterface
  124. */
  125. public function getView()
  126. {
  127. return $this->_view;
  128. }
  129. /**
  130. * @return \Magento\Framework\ObjectManagerInterface
  131. */
  132. public function getObjectManager()
  133. {
  134. return $this->_objectManager;
  135. }
  136. /**
  137. * @return \Magento\Framework\App\Response\RedirectInterface
  138. */
  139. public function getRedirect()
  140. {
  141. return $this->_redirect;
  142. }
  143. /**
  144. * @return \Magento\Framework\App\RequestInterface
  145. */
  146. public function getRequest()
  147. {
  148. return $this->_request;
  149. }
  150. /**
  151. * @return \Magento\Framework\App\ResponseInterface
  152. */
  153. public function getResponse()
  154. {
  155. return $this->_response;
  156. }
  157. /**
  158. * @return \Magento\Framework\UrlInterface
  159. */
  160. public function getUrl()
  161. {
  162. return $this->_url;
  163. }
  164. /**
  165. * @return \Magento\Framework\Message\ManagerInterface
  166. */
  167. public function getMessageManager()
  168. {
  169. return $this->messageManager;
  170. }
  171. /**
  172. * @return \Magento\Framework\Controller\Result\RedirectFactory
  173. */
  174. public function getResultRedirectFactory()
  175. {
  176. return $this->resultRedirectFactory;
  177. }
  178. /**
  179. * @return \Magento\Framework\Controller\ResultFactory
  180. */
  181. public function getResultFactory()
  182. {
  183. return $this->resultFactory;
  184. }
  185. }