[TASK] Sync CMS Fluid with Flow Fluid 1.1 (part1)
[Packages/TYPO3.CMS.git] / typo3 / sysext / fluid / Classes / Core / Rendering / RenderingContext.php
1 <?php
2 namespace TYPO3\CMS\Fluid\Core\Rendering;
3
4 /* *
5 * This script is backported from the TYPO3 Flow package "TYPO3.Fluid". *
6 * *
7 * It is free software; you can redistribute it and/or modify it under *
8 * the terms of the GNU Lesser General Public License, either version 3 *
9 * of the License, or (at your option) any later version. *
10 * *
11 * The TYPO3 project - inspiring people to share! *
12 * */
13
14 class RenderingContext implements \TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface {
15
16 /**
17 * Template Variable Container. Contains all variables available through object accessors in the template
18 *
19 * @var \TYPO3\CMS\Fluid\Core\ViewHelper\TemplateVariableContainer
20 */
21 protected $templateVariableContainer;
22
23 /**
24 * Object manager which is bubbled through. The ViewHelperNode cannot get an ObjectManager injected because
25 * the whole syntax tree should be cacheable
26 *
27 * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
28 */
29 protected $objectManager;
30
31 /**
32 * Controller context being passed to the ViewHelper
33 *
34 * @var \TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext
35 */
36 protected $controllerContext;
37
38 /**
39 * ViewHelper Variable Container
40 *
41 * @var \TYPO3\CMS\Fluid\Core\ViewHelper\ViewHelperVariableContainer
42 */
43 protected $viewHelperVariableContainer;
44
45 /**
46 * Inject the object manager
47 *
48 * @param \TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager
49 */
50 public function injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager) {
51 $this->objectManager = $objectManager;
52 }
53
54 /**
55 * Returns the object manager. Only the ViewHelperNode should do this.
56 *
57 * @return \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
58 */
59 public function getObjectManager() {
60 return $this->objectManager;
61 }
62
63 /**
64 * Injects the template variable container containing all variables available through ObjectAccessors
65 * in the template
66 *
67 * @param \TYPO3\CMS\Fluid\Core\ViewHelper\TemplateVariableContainer $templateVariableContainer The template variable container to set
68 */
69 public function injectTemplateVariableContainer(\TYPO3\CMS\Fluid\Core\ViewHelper\TemplateVariableContainer $templateVariableContainer) {
70 $this->templateVariableContainer = $templateVariableContainer;
71 }
72
73 /**
74 * Get the template variable container
75 *
76 * @return \TYPO3\CMS\Fluid\Core\ViewHelper\TemplateVariableContainer The Template Variable Container
77 */
78 public function getTemplateVariableContainer() {
79 return $this->templateVariableContainer;
80 }
81
82 /**
83 * Set the controller context which will be passed to the ViewHelper
84 *
85 * @param \TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext $controllerContext The controller context to set
86 */
87 public function setControllerContext(\TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext $controllerContext) {
88 $this->controllerContext = $controllerContext;
89 }
90
91 /**
92 * Get the controller context which will be passed to the ViewHelper
93 *
94 * @return \TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext The controller context to set
95 */
96 public function getControllerContext() {
97 return $this->controllerContext;
98 }
99
100 /**
101 * Set the ViewHelperVariableContainer
102 *
103 * @param \TYPO3\CMS\Fluid\Core\ViewHelper\ViewHelperVariableContainer $viewHelperVariableContainer
104 * @return void
105 */
106 public function injectViewHelperVariableContainer(\TYPO3\CMS\Fluid\Core\ViewHelper\ViewHelperVariableContainer $viewHelperVariableContainer) {
107 $this->viewHelperVariableContainer = $viewHelperVariableContainer;
108 }
109
110 /**
111 * Get the ViewHelperVariableContainer
112 *
113 * @return \TYPO3\CMS\Fluid\Core\ViewHelper\ViewHelperVariableContainer
114 */
115 public function getViewHelperVariableContainer() {
116 return $this->viewHelperVariableContainer;
117 }
118 }
119
120 ?>