[TASK] Streamline phpdoc annotations in EXT:fluid
[Packages/TYPO3.CMS.git] / typo3 / sysext / fluid / Classes / Core / Widget / WidgetContext.php
1 <?php
2 namespace TYPO3\CMS\Fluid\Core\Widget;
3
4 /*
5 * This file is part of the TYPO3 CMS project.
6 *
7 * It is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License, either version 2
9 * of the License, or any later version.
10 *
11 * For the full copyright and license information, please read the
12 * LICENSE.txt file that was distributed with this source code.
13 *
14 * The TYPO3 project - inspiring people to share!
15 */
16
17 /**
18 * The WidgetContext stores all information a widget needs to know about the
19 * environment.
20 *
21 * The WidgetContext can be fetched from the current WidgetRequest, and is thus
22 * available throughout the whole sub-request of the widget. It is used internally
23 * by various ViewHelpers (like <f:widget.link>, <f:widget.uri>, <f:widget.renderChildren>),
24 * to get knowledge over the current widget's configuration.
25 *
26 * @internal It is a purely internal class which should not be used outside of Fluid.
27 */
28 class WidgetContext
29 {
30 /**
31 * Uniquely identifies a Widget Instance on a certain page.
32 *
33 * @var string
34 */
35 protected $widgetIdentifier;
36
37 /**
38 * Per-User unique identifier of the widget, if it is an AJAX widget.
39 *
40 * @var string
41 */
42 protected $ajaxWidgetIdentifier;
43
44 /**
45 * User-supplied widget configuration, available inside the widget
46 * controller as $this->widgetConfiguration.
47 *
48 * @var array
49 */
50 protected $widgetConfiguration;
51
52 /**
53 * The fully qualified object name of the Controller which this widget uses.
54 *
55 * @var string
56 */
57 protected $controllerObjectName;
58
59 /**
60 * The child nodes of the Widget ViewHelper.
61 * Only available inside non-AJAX requests.
62 *
63 * @var \TYPO3Fluid\Fluid\Core\Parser\SyntaxTree\RootNode
64 */
65 protected $viewHelperChildNodes;
66
67 /**
68 * The rendering context of the ViewHelperChildNodes.
69 * Only available inside non-AJAX requests.
70 * @todo rename to something more meaningful.
71 *
72 * @var \TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface
73 */
74 protected $viewHelperChildNodeRenderingContext;
75
76 /**
77 * @var string
78 */
79 protected $parentPluginNamespace;
80
81 /**
82 * @var string
83 */
84 protected $parentExtensionName;
85
86 /**
87 * @var string
88 */
89 protected $parentPluginName;
90
91 /**
92 * @var string
93 */
94 protected $widgetViewHelperClassName;
95
96 /**
97 * @return string
98 */
99 public function getWidgetIdentifier()
100 {
101 return $this->widgetIdentifier;
102 }
103
104 /**
105 * @param string $widgetIdentifier
106 */
107 public function setWidgetIdentifier($widgetIdentifier)
108 {
109 $this->widgetIdentifier = $widgetIdentifier;
110 }
111
112 /**
113 * @return string
114 */
115 public function getAjaxWidgetIdentifier()
116 {
117 return $this->ajaxWidgetIdentifier;
118 }
119
120 /**
121 * @param string $ajaxWidgetIdentifier
122 */
123 public function setAjaxWidgetIdentifier($ajaxWidgetIdentifier)
124 {
125 $this->ajaxWidgetIdentifier = $ajaxWidgetIdentifier;
126 }
127
128 /**
129 * Sets the URI namespace of the plugin that contains the widget
130 *
131 * @param string $parentPluginNamespace
132 */
133 public function setParentPluginNamespace($parentPluginNamespace)
134 {
135 $this->parentPluginNamespace = $parentPluginNamespace;
136 }
137
138 /**
139 * Returns the URI namespace of the plugin that contains the widget
140 *
141 * @return string
142 */
143 public function getParentPluginNamespace()
144 {
145 return $this->parentPluginNamespace;
146 }
147
148 /**
149 * Sets the Extension name of the plugin that contains the widget
150 *
151 * @param string $parentExtensionName
152 */
153 public function setParentExtensionName($parentExtensionName)
154 {
155 $this->parentExtensionName = $parentExtensionName;
156 }
157
158 /**
159 * Returns the Extension name of the plugin that contains the widget
160 *
161 * @return string
162 */
163 public function getParentExtensionName()
164 {
165 return $this->parentExtensionName;
166 }
167
168 /**
169 * Sets the name of the plugin that contains the widget
170 *
171 * @param string $parentPluginName
172 */
173 public function setParentPluginName($parentPluginName)
174 {
175 $this->parentPluginName = $parentPluginName;
176 }
177
178 /**
179 * Returns the name of the plugin that contains the widget
180 *
181 * @return string
182 */
183 public function getParentPluginName()
184 {
185 return $this->parentPluginName;
186 }
187
188 /**
189 * Sets the fully qualified class name of the view helper this context belongs to
190 *
191 * @param string $widgetViewHelperClassName
192 */
193 public function setWidgetViewHelperClassName($widgetViewHelperClassName)
194 {
195 $this->widgetViewHelperClassName = $widgetViewHelperClassName;
196 }
197
198 /**
199 * Returns the fully qualified class name of the view helper this context belongs to
200 *
201 * @return string
202 */
203 public function getWidgetViewHelperClassName()
204 {
205 return $this->widgetViewHelperClassName;
206 }
207
208 /**
209 * @return array
210 */
211 public function getWidgetConfiguration()
212 {
213 return $this->widgetConfiguration;
214 }
215
216 /**
217 * @param array $widgetConfiguration
218 */
219 public function setWidgetConfiguration($widgetConfiguration)
220 {
221 $this->widgetConfiguration = $widgetConfiguration;
222 }
223
224 /**
225 * @return string
226 */
227 public function getControllerObjectName()
228 {
229 return $this->controllerObjectName;
230 }
231
232 /**
233 * @param string $controllerObjectName
234 */
235 public function setControllerObjectName($controllerObjectName)
236 {
237 $this->controllerObjectName = $controllerObjectName;
238 }
239
240 /**
241 * @param \TYPO3Fluid\Fluid\Core\Parser\SyntaxTree\RootNode $viewHelperChildNodes
242 * @param \TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface $viewHelperChildNodeRenderingContext
243 */
244 public function setViewHelperChildNodes(\TYPO3Fluid\Fluid\Core\Parser\SyntaxTree\RootNode $viewHelperChildNodes, \TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface $viewHelperChildNodeRenderingContext)
245 {
246 $this->viewHelperChildNodes = $viewHelperChildNodes;
247 $this->viewHelperChildNodeRenderingContext = $viewHelperChildNodeRenderingContext;
248 }
249
250 /**
251 * @return \TYPO3Fluid\Fluid\Core\Parser\SyntaxTree\RootNode
252 */
253 public function getViewHelperChildNodes()
254 {
255 return $this->viewHelperChildNodes;
256 }
257
258 /**
259 * @return \TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface
260 */
261 public function getViewHelperChildNodeRenderingContext()
262 {
263 return $this->viewHelperChildNodeRenderingContext;
264 }
265
266 /**
267 * @return array
268 */
269 public function __sleep()
270 {
271 return ['widgetIdentifier', 'ajaxWidgetIdentifier', 'widgetConfiguration', 'controllerObjectName', 'parentPluginNamespace', 'parentExtensionName', 'parentPluginName', 'widgetViewHelperClassName'];
272 }
273 }