[+FEATURE] Backport CommandController Implementation
[Packages/TYPO3.CMS.git] / typo3 / sysext / extbase / Classes / MVC / RequestInterface.php
1 <?php
2 /***************************************************************
3 * Copyright notice
4 *
5 * (c) 2009 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 * Contract for a request.
30 *
31 * @version $Id$
32 * @scope prototype
33 * @api
34 */
35 interface Tx_Extbase_MVC_RequestInterface {
36
37 /**
38 * Sets the dispatched flag
39 *
40 * @param boolean $flag If this request has been dispatched
41 * @return void
42 * @api
43 */
44 public function setDispatched($flag);
45
46 /**
47 * If this request has been dispatched and addressed by the responsible
48 * controller and the response is ready to be sent.
49 *
50 * The dispatcher will try to dispatch the request again if it has not been
51 * addressed yet.
52 *
53 * @return boolean TRUE if this request has been disptached successfully
54 * @api
55 */
56 public function isDispatched();
57
58 /**
59 * Returns the object name of the controller defined by the package key and
60 * controller name
61 *
62 * @return string The controller's Object Name
63 * @throws Tx_Extbase_MVC_Exception_NoSuchController if the controller does not exist
64 * @api
65 */
66 public function getControllerObjectName();
67
68 /**
69 * Sets the value of the specified argument
70 *
71 * @param string $argumentName Name of the argument to set
72 * @param mixed $value The new value
73 * @return void
74 * @api
75 */
76 public function setArgument($argumentName, $value);
77
78 /**
79 * Sets the whole arguments array and therefore replaces any arguments
80 * which existed before.
81 *
82 * @param array $arguments An array of argument names and their values
83 * @return void
84 * @api
85 */
86 public function setArguments(array $arguments);
87
88 /**
89 * Returns the value of the specified argument
90 *
91 * @param string $argumentName Name of the argument
92 * @return string Value of the argument
93 * @throws Tx_Extbase_MVC_Exception_NoSuchArgument if such an argument does not exist
94 * @api
95 */
96 public function getArgument($argumentName);
97
98 /**
99 * Checks if an argument of the given name exists (is set)
100 *
101 * @param string $argumentName Name of the argument to check
102 * @return boolean TRUE if the argument is set, otherwise FALSE
103 * @api
104 */
105 public function hasArgument($argumentName);
106
107 /**
108 * Returns an array of arguments and their values
109 *
110 * @return array Array of arguments and their values (which may be arguments and values as well)
111 * @api
112 */
113 public function getArguments();
114
115 }
116 ?>