[~TAKS] Extbase (MVC): FrontendRequestHandler now retrieves the current cObject throu...
[Packages/TYPO3.CMS.git] / typo3 / sysext / extbase / Classes / MVC / Web / AbstractRequestHandler.php
1 <?php
2 /***************************************************************
3 * Copyright notice
4 *
5 * (c) 2010 Jochen Rau <jochen.rau@typoplanet.de>
6 * All rights reserved
7 *
8 * This class is a backport of the corresponding class of FLOW3.
9 * All credits go to the v5 team.
10 *
11 * This script is part of the TYPO3 project. The TYPO3 project is
12 * free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
16 *
17 * The GNU General Public License can be found at
18 * http://www.gnu.org/copyleft/gpl.html.
19 *
20 * This script is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 *
25 * This copyright notice MUST APPEAR in all copies of the script!
26 ***************************************************************/
27
28 /**
29 * A request handler which can handle web requests.
30 *
31 */
32 abstract class Tx_Extbase_MVC_Web_AbstractRequestHandler implements Tx_Extbase_MVC_RequestHandlerInterface {
33
34 /**
35 * @var Tx_Extbase_Object_ObjectManagerInterface
36 */
37 protected $objectManager;
38
39 /**
40 * @var Tx_Extbase_MVC_Dispatcher
41 */
42 protected $dispatcher;
43
44 /**
45 * @var Tx_Extbase_MVC_Web_RequestBuilder
46 */
47 protected $requestBuilder;
48
49 /**
50 * @var Tx_Extbase_MVC_Controller_FlashMessages
51 */
52 protected $flashMessages;
53
54 /**
55 * @param Tx_Extbase_Object_ObjectManagerInterface $objectManager
56 * @return void
57 */
58 public function injectObjectManager(Tx_Extbase_Object_ObjectManagerInterface $objectManager) {
59 $this->objectManager = $objectManager;
60 }
61
62 /**
63 * @param Tx_Extbase_Object_ObjectManagerInterface $objectManager
64 * @return void
65 */
66 public function injectFlashMessages(Tx_Extbase_MVC_Controller_FlashMessages $flashMessages) {
67 $this->flashMessages = $flashMessages;
68 }
69
70 /**
71 * @param Tx_Extbase_MVC_Dispatcher $dispatcher
72 * @return void
73 */
74 public function injectDispatcher(Tx_Extbase_MVC_Dispatcher $dispatcher) {
75 $this->dispatcher = $dispatcher;
76 }
77
78 /**
79 * @param Tx_Extbase_MVC_Web_RequestBuilder $requestBuilder
80 * @return void
81 */
82 public function injectRequestBuilder(Tx_Extbase_MVC_Web_RequestBuilder $requestBuilder) {
83 $this->requestBuilder = $requestBuilder;
84 }
85
86 /**
87 * This request handler can handle any web request.
88 *
89 * @return boolean If the request is a web request, TRUE otherwise FALSE
90 */
91 public function canHandleRequest() {
92 return TRUE;
93 }
94
95 /**
96 * Returns the priority - how eager the handler is to actually handle the
97 * request.
98 *
99 * @return integer The priority of the request handler.
100 */
101 public function getPriority() {
102 return 100;
103 }
104
105 }
106 ?>