TYPO3 CMS  TYPO3_7-6
Request.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 $objectManager;
29 
34 
38  protected $controllerCommandName = 'default';
39 
43  protected $controllerExtensionName = null;
44 
50  protected $arguments = [];
51 
55  protected $exceedingArguments = [];
56 
62  protected $dispatched = false;
63 
68 
72  protected $command = null;
73 
77  protected $callingScript;
78 
82  public function injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager)
83  {
84  $this->objectManager = $objectManager;
85  }
86 
91  {
92  $this->callingScript = $callingScript;
93  }
94 
98  public function getCallingScript()
99  {
100  return $this->callingScript;
101  }
102 
109  public function setDispatched($flag)
110  {
111  $this->dispatched = (bool)$flag;
112  }
113 
123  public function isDispatched()
124  {
125  return $this->dispatched;
126  }
127 
135  {
137 
138  $this->controllerExtensionName = $nameParts['extensionName'];
139  $this->controllerObjectName = $controllerObjectName;
140  $this->command = null;
141  }
142 
148  public function getControllerObjectName()
149  {
151  }
152 
158  public function getControllerExtensionName()
159  {
161  }
162 
171  public function setControllerCommandName($commandName)
172  {
173  $this->controllerCommandName = $commandName;
174  $this->command = null;
175  }
176 
182  public function getControllerCommandName()
183  {
185  }
186 
192  public function getCommand()
193  {
194  if ($this->command === null) {
195  $this->command = $this->objectManager->get(\TYPO3\CMS\Extbase\Mvc\Cli\Command::class, $this->controllerObjectName, $this->controllerCommandName);
196  }
197  return $this->command;
198  }
199 
208  public function setArgument($argumentName, $value)
209  {
210  if (!is_string($argumentName) || $argumentName === '') {
211  throw new \TYPO3\CMS\Extbase\Mvc\Exception\InvalidArgumentNameException('Invalid argument name.', 1300893885);
212  }
213  $this->arguments[$argumentName] = $value;
214  }
215 
223  public function setArguments(array $arguments)
224  {
225  $this->arguments = $arguments;
226  }
227 
235  public function getArgument($argumentName)
236  {
237  if (!isset($this->arguments[$argumentName])) {
238  throw new \TYPO3\CMS\Extbase\Mvc\Exception\NoSuchArgumentException('An argument "' . $argumentName . '" does not exist for this request.', 1300893886);
239  }
240  return $this->arguments[$argumentName];
241  }
242 
249  public function hasArgument($argumentName)
250  {
251  return isset($this->arguments[$argumentName]);
252  }
253 
259  public function getArguments()
260  {
261  return $this->arguments;
262  }
263 
271  {
272  $this->exceedingArguments = $exceedingArguments;
273  }
274 
285  public function getExceedingArguments()
286  {
288  }
289 }
setArgument($argumentName, $value)
Definition: Request.php:208
static explodeObjectControllerName($controllerObjectName)
injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager)
Definition: Request.php:82
setArguments(array $arguments)
Definition: Request.php:223
setExceedingArguments(array $exceedingArguments)
Definition: Request.php:270
setControllerCommandName($commandName)
Definition: Request.php:171
setCallingScript($callingScript)
Definition: Request.php:90
setControllerObjectName($controllerObjectName)
Definition: Request.php:134