8da409d2df0dcdf80806ff7a84e9017e73f17d77
[Packages/TYPO3.CMS.git] / typo3 / sysext / extbase / Classes / Mvc / Web / AbstractRequestHandler.php
1 <?php
2 namespace TYPO3\CMS\Extbase\Mvc\Web;
3
4 /***************************************************************
5 * Copyright notice
6 *
7 * (c) 2010 Jochen Rau <jochen.rau@typoplanet.de>
8 * All rights reserved
9 *
10 * This class is a backport of the corresponding class of FLOW3.
11 * All credits go to the v5 team.
12 *
13 * This script is part of the TYPO3 project. The TYPO3 project is
14 * free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
18 *
19 * The GNU General Public License can be found at
20 * http://www.gnu.org/copyleft/gpl.html.
21 *
22 * This script is distributed in the hope that it will be useful,
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 * GNU General Public License for more details.
26 *
27 * This copyright notice MUST APPEAR in all copies of the script!
28 ***************************************************************/
29 /**
30 * A request handler which can handle web requests.
31 */
32 abstract class AbstractRequestHandler implements \TYPO3\CMS\Extbase\Mvc\RequestHandlerInterface {
33
34 /**
35 * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
36 */
37 protected $objectManager;
38
39 /**
40 * @var \TYPO3\CMS\Extbase\Mvc\Dispatcher
41 */
42 protected $dispatcher;
43
44 /**
45 * @var \TYPO3\CMS\Extbase\Mvc\Web\RequestBuilder
46 */
47 protected $requestBuilder;
48
49 /**
50 * @var \TYPO3\CMS\Extbase\Mvc\Controller\FlashMessages
51 */
52 protected $flashMessageContainer;
53
54 /**
55 * @param \TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager
56 * @return void
57 */
58 public function injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager) {
59 $this->objectManager = $objectManager;
60 }
61
62 /**
63 * @param \TYPO3\CMS\Extbase\Mvc\Controller\FlashMessages $flashMessageContainer
64 * @return void
65 */
66 public function injectFlashMessageContainer(\TYPO3\CMS\Extbase\Mvc\Controller\FlashMessages $flashMessageContainer) {
67 $this->flashMessageContainer = $flashMessageContainer;
68 }
69
70 /**
71 * @param \TYPO3\CMS\Extbase\Mvc\Dispatcher $dispatcher
72 * @return void
73 */
74 public function injectDispatcher(\TYPO3\CMS\Extbase\Mvc\Dispatcher $dispatcher) {
75 $this->dispatcher = $dispatcher;
76 }
77
78 /**
79 * @param \TYPO3\CMS\Extbase\Mvc\Web\RequestBuilder $requestBuilder
80 * @return void
81 */
82 public function injectRequestBuilder(\TYPO3\CMS\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
107
108 ?>