1 | <?php |
||
39 | abstract class Controller |
||
40 | { |
||
41 | /** |
||
42 | * @var ExecutionContainer This controller's execution container. |
||
43 | */ |
||
44 | protected $container = null; |
||
45 | |||
46 | /** |
||
47 | * @var Context A Context instance. |
||
48 | */ |
||
49 | protected $context = null; |
||
50 | |||
51 | /** |
||
52 | * Retrieve the current application context. |
||
53 | * |
||
54 | * @return Context The current Context instance. |
||
55 | * |
||
56 | * @author Sean Kerr <[email protected]> |
||
57 | * @since 0.9.0 |
||
58 | */ |
||
59 | final public function getContext() |
||
63 | |||
64 | /** |
||
65 | * Retrieve the execution container for this controller. |
||
66 | * |
||
67 | * @return ExecutionContainer This controller's execution container. |
||
68 | * |
||
69 | * @author David Zülke <[email protected]> |
||
70 | * @since 0.11.0 |
||
71 | */ |
||
72 | final public function getContainer() |
||
76 | |||
77 | /** |
||
78 | * Retrieve the credential required to access this controller. |
||
79 | * |
||
80 | * @return mixed Data that indicates the level of security for this |
||
81 | * controller. |
||
82 | * |
||
83 | * @author Sean Kerr <[email protected]> |
||
84 | * @author David Zülke <[email protected]> |
||
85 | * @since 0.9.0 |
||
86 | */ |
||
87 | public function getCredentials() |
||
91 | |||
92 | /** |
||
93 | * Execute any post-validation error application logic. |
||
94 | * |
||
95 | * @param RequestDataHolder $rd The controller's request data holder. |
||
96 | * |
||
97 | * @return mixed A string containing the view name associated with this |
||
98 | * controller. |
||
99 | * Or an array with the following indices: |
||
100 | * - The parent module of the view that will be executed. |
||
101 | * - The view that will be executed. |
||
102 | * |
||
103 | * @author Sean Kerr <[email protected]> |
||
104 | * @author David Zülke <[email protected]> |
||
105 | * @since 0.9.0 |
||
106 | */ |
||
107 | public function handleError(RequestDataHolder $rd) |
||
111 | |||
112 | /** |
||
113 | * Initialize this controller. |
||
114 | * |
||
115 | * @param ExecutionContainer $container This Controller's execution container. |
||
116 | * |
||
117 | * @author David Zülke <[email protected]> |
||
118 | * @since 0.9.0 |
||
119 | */ |
||
120 | public function initialize(ExecutionContainer $container) |
||
126 | |||
127 | /** |
||
128 | * Indicates that this controller requires security. |
||
129 | * |
||
130 | * @return bool true, if this controller requires security, otherwise false. |
||
131 | * |
||
132 | * @author Sean Kerr <[email protected]> |
||
133 | * @since 0.9.0 |
||
134 | */ |
||
135 | public function isSecure() |
||
139 | |||
140 | /** |
||
141 | * Whether or not this controller is "simple", i.e. does not use validation etc. |
||
142 | * |
||
143 | * @return bool true, if this controller should act in simple mode, or false. |
||
144 | * |
||
145 | * @author David Zülke <[email protected]> |
||
146 | * @since 0.11.0 |
||
147 | */ |
||
148 | public function isSimple() |
||
152 | |||
153 | /** |
||
154 | * Manually register validators for this controller. |
||
155 | * |
||
156 | * @author Sean Kerr <[email protected]> |
||
157 | * @since 0.9.0 |
||
158 | */ |
||
159 | public function registerValidators() |
||
162 | |||
163 | /** |
||
164 | * Manually validate files and parameters. |
||
165 | * |
||
166 | * @param RequestDataHolder $rd The controller's request data holder. |
||
167 | * |
||
168 | * @return bool true, if validation completed successfully, otherwise |
||
169 | * false. |
||
170 | * |
||
171 | * @author Sean Kerr <[email protected]> |
||
172 | * @author David Zülke <[email protected]> |
||
173 | * @since 0.9.0 |
||
174 | */ |
||
175 | public function validate(RequestDataHolder $rd) |
||
179 | |||
180 | /** |
||
181 | * Get the default View name if this Controller doesn't serve the Request method. |
||
182 | * |
||
183 | * @return mixed A string containing the view name associated with this |
||
184 | * controller. |
||
185 | * Or an array with the following indices: |
||
186 | * - The parent module of the view that will be executed. |
||
187 | * - The view that will be executed. |
||
188 | * |
||
189 | * @author David Zülke <[email protected]> |
||
190 | * @since 0.11.0 |
||
191 | */ |
||
192 | public function getDefaultViewName() |
||
196 | |||
197 | /** |
||
198 | * @see AttributeHolder::clearAttributes() |
||
199 | * |
||
200 | * @author David Zülke <[email protected]> |
||
201 | * @since 0.9.0 |
||
202 | */ |
||
203 | public function clearAttributes() |
||
207 | |||
208 | /** |
||
209 | * @see AttributeHolder::getAttribute() |
||
210 | * |
||
211 | * @author David Zülke <[email protected]> |
||
212 | * @since 0.9.0 |
||
213 | */ |
||
214 | public function &getAttribute($name, $default = null) |
||
218 | |||
219 | /** |
||
220 | * @see AttributeHolder::getAttributeNames() |
||
221 | * |
||
222 | * @author David Zülke <[email protected]> |
||
223 | * @since 0.9.0 |
||
224 | */ |
||
225 | public function getAttributeNames() |
||
229 | |||
230 | /** |
||
231 | * @see AttributeHolder::getAttributes() |
||
232 | * |
||
233 | * @author David Zülke <[email protected]> |
||
234 | * @since 0.11.0 |
||
235 | */ |
||
236 | public function &getAttributes() |
||
240 | |||
241 | /** |
||
242 | * @see AttributeHolder::hasAttribute() |
||
243 | * |
||
244 | * @author David Zülke <[email protected]> |
||
245 | * @since 0.9.0 |
||
246 | */ |
||
247 | public function hasAttribute($name) |
||
251 | |||
252 | /** |
||
253 | * @see AttributeHolder::removeAttribute() |
||
254 | * |
||
255 | * @author David Zülke <[email protected]> |
||
256 | * @since 0.9.0 |
||
257 | */ |
||
258 | public function &removeAttribute($name) |
||
262 | |||
263 | /** |
||
264 | * @see AttributeHolder::setAttribute() |
||
265 | * |
||
266 | * @author David Zülke <[email protected]> |
||
267 | * @since 0.9.0 |
||
268 | */ |
||
269 | public function setAttribute($name, $value) |
||
273 | |||
274 | /** |
||
275 | * @see AttributeHolder::appendAttribute() |
||
276 | * |
||
277 | * @author David Zülke <[email protected]> |
||
278 | * @since 0.10.0 |
||
279 | */ |
||
280 | public function appendAttribute($name, $value) |
||
284 | |||
285 | /** |
||
286 | * @see AttributeHolder::setAttributeByRef() |
||
287 | * |
||
288 | * @author David Zülke <[email protected]> |
||
289 | * @since 0.9.0 |
||
290 | */ |
||
291 | public function setAttributeByRef($name, &$value) |
||
295 | |||
296 | /** |
||
297 | * @see AttributeHolder::appendAttributeByRef() |
||
298 | * |
||
299 | * @author David Zülke <[email protected]> |
||
300 | * @since 0.10.0 |
||
301 | */ |
||
302 | public function appendAttributeByRef($name, &$value) |
||
306 | |||
307 | /** |
||
308 | * @see AttributeHolder::setAttributes() |
||
309 | * |
||
310 | * @author David Zülke <[email protected]> |
||
311 | * @since 0.9.0 |
||
312 | */ |
||
313 | public function setAttributes(array $attributes) |
||
317 | |||
318 | /** |
||
319 | * @see AttributeHolder::setAttributesByRef() |
||
320 | * |
||
321 | * @author David Zülke <[email protected]> |
||
322 | * @since 0.9.0 |
||
323 | */ |
||
324 | public function setAttributesByRef(array &$attributes) |
||
328 | } |
||
329 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.