TYPO3 CMS  TYPO3_8-7
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 
81  public function setRequest(\TYPO3\CMS\Extbase\Mvc\Request $request)
82  {
83  $this->request = $request;
84  }
85 
92  public function getRequest()
93  {
94  return $this->request;
95  }
96 
102  public function setResponse(\TYPO3\CMS\Extbase\Mvc\Response $response)
103  {
104  $this->response = $response;
105  }
106 
113  public function getResponse()
114  {
115  return $this->response;
116  }
117 
123  public function setArguments(\TYPO3\CMS\Extbase\Mvc\Controller\Arguments $arguments)
124  {
125  $this->arguments = $arguments;
126  }
127 
134  public function getArguments()
135  {
136  return $this->arguments;
137  }
138 
142  public function setUriBuilder(\TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder $uriBuilder)
143  {
144  $this->uriBuilder = $uriBuilder;
145  }
146 
151  public function getUriBuilder()
152  {
153  return $this->uriBuilder;
154  }
155 
161  public function getFlashMessageQueue($identifier = null)
162  {
163  if ($identifier === null) {
164  if ($this->flashMessageQueueDefaultIdentifier === null) {
165  // cache the default-identifier for performance-reasons
166  $this->flashMessageQueueDefaultIdentifier = 'extbase.flashmessages.' . $this->extensionService->getPluginNamespace($this->request->getControllerExtensionName(), $this->request->getPluginName());
167  }
169  }
170  return $this->flashMessageService->getMessageQueueByIdentifier($identifier);
171  }
172 }
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)