TYPO3 CMS  TYPO3_7-6
ControllerContext.php
Go to the documentation of this file.
1 <?php
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 
24 {
28  protected $request;
29 
33  protected $response;
34 
38  protected $arguments;
39 
43  protected $uriBuilder;
44 
49 
54 
58  protected $extensionService;
59 
63  public function injectFlashMessageService(\TYPO3\CMS\Core\Messaging\FlashMessageService $flashMessageService)
64  {
65  $this->flashMessageService = $flashMessageService;
66  }
67 
71  public function injectExtensionService(\TYPO3\CMS\Extbase\Service\ExtensionService $extensionService)
72  {
73  $this->extensionService = $extensionService;
74  }
75 
82  public function setRequest(\TYPO3\CMS\Extbase\Mvc\Request $request)
83  {
84  $this->request = $request;
85  }
86 
93  public function getRequest()
94  {
95  return $this->request;
96  }
97 
104  public function setResponse(\TYPO3\CMS\Extbase\Mvc\Response $response)
105  {
106  $this->response = $response;
107  }
108 
115  public function getResponse()
116  {
117  return $this->response;
118  }
119 
126  public function setArguments(\TYPO3\CMS\Extbase\Mvc\Controller\Arguments $arguments)
127  {
128  $this->arguments = $arguments;
129  }
130 
137  public function getArguments()
138  {
139  return $this->arguments;
140  }
141 
146  public function setUriBuilder(\TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder $uriBuilder)
147  {
148  $this->uriBuilder = $uriBuilder;
149  }
150 
155  public function getUriBuilder()
156  {
157  return $this->uriBuilder;
158  }
159 
165  public function getFlashMessageQueue($identifier = null)
166  {
167  if ($identifier === null) {
168  if ($this->flashMessageQueueDefaultIdentifier === null) {
169  // cache the default-identifier for performance-reasons
170  $this->flashMessageQueueDefaultIdentifier = 'extbase.flashmessages.' . $this->extensionService->getPluginNamespace($this->request->getControllerExtensionName(), $this->request->getPluginName());
171  }
173  }
174  return $this->flashMessageService->getMessageQueueByIdentifier($identifier);
175  }
176 }
setUriBuilder(\TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder $uriBuilder)
setRequest(\TYPO3\CMS\Extbase\Mvc\Request $request)
injectExtensionService(\TYPO3\CMS\Extbase\Service\ExtensionService $extensionService)
setResponse(\TYPO3\CMS\Extbase\Mvc\Response $response)
setArguments(\TYPO3\CMS\Extbase\Mvc\Controller\Arguments $arguments)
injectFlashMessageService(\TYPO3\CMS\Core\Messaging\FlashMessageService $flashMessageService)