‪TYPO3CMS  9.5
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 
23 {
27  protected ‪$objectManager;
28 
32  protected ‪$controllerObjectName;
33 
37  protected ‪$controllerCommandName = 'default';
38 
43 
49  protected ‪$arguments = [];
50 
54  protected ‪$exceedingArguments = [];
55 
61  protected ‪$dispatched = false;
62 
67 
71  protected ‪$command;
72 
76  protected ‪$callingScript;
77 
81  public function ‪injectObjectManager(\‪TYPO3\CMS\‪Extbase\Object\ObjectManagerInterface ‪$objectManager)
82  {
83  $this->objectManager = ‪$objectManager;
84  }
85 
89  public function ‪setCallingScript(‪$callingScript)
90  {
91  $this->callingScript = ‪$callingScript;
92  }
93 
97  public function ‪getCallingScript()
98  {
100  }
101 
107  public function ‪setDispatched($flag)
108  {
109  $this->dispatched = (bool)$flag;
110  }
111 
121  public function ‪isDispatched()
122  {
123  return ‪$this->dispatched;
124  }
125 
132  {
134 
135  $this->controllerExtensionName = $nameParts['extensionName'];
136  $this->controllerObjectName = ‪$controllerObjectName;
137  $this->command = null;
138  }
139 
145  public function ‪getControllerObjectName()
146  {
148  }
149 
155  public function ‪getControllerExtensionName()
156  {
158  }
159 
167  public function ‪setControllerCommandName($commandName)
168  {
169  $this->controllerCommandName = $commandName;
170  $this->command = null;
171  }
172 
178  public function ‪getControllerCommandName()
179  {
181  }
182 
188  public function ‪getCommand()
189  {
190  if ($this->command === null) {
191  $this->command = $this->objectManager->get(\‪TYPO3\CMS\‪Extbase\Mvc\Cli\Command::class, $this->controllerObjectName, $this->controllerCommandName);
192  }
194  }
195 
203  public function ‪setArgument($argumentName, $value)
204  {
205  if (!is_string($argumentName) || $argumentName === '') {
206  throw new \TYPO3\CMS\Extbase\Mvc\Exception\InvalidArgumentNameException('Invalid argument name.', 1300893885);
207  }
208  $this->arguments[$argumentName] = $value;
209  }
210 
217  public function ‪setArguments(array ‪$arguments)
218  {
219  $this->arguments = ‪$arguments;
220  }
221 
229  public function ‪getArgument($argumentName)
230  {
231  if (!isset($this->arguments[$argumentName])) {
232  throw new \TYPO3\CMS\Extbase\Mvc\Exception\NoSuchArgumentException('An argument "' . $argumentName . '" does not exist for this request.', 1300893886);
233  }
234  return $this->arguments[$argumentName];
235  }
236 
243  public function ‪hasArgument($argumentName)
244  {
245  return isset($this->arguments[$argumentName]);
246  }
247 
253  public function ‪getArguments()
254  {
255  return ‪$this->arguments;
256  }
257 
263  public function ‪setExceedingArguments(array ‪$exceedingArguments)
264  {
265  $this->exceedingArguments = ‪$exceedingArguments;
266  }
267 
278  public function ‪getExceedingArguments()
279  {
281  }
282 }
‪TYPO3\CMS\Extbase\Mvc\Cli\Request\isDispatched
‪bool isDispatched()
Definition: Request.php:111
‪TYPO3\CMS\Extbase\Mvc\Cli\Request\injectObjectManager
‪injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager)
Definition: Request.php:71
‪TYPO3\CMS\Extbase\Annotation
Definition: IgnoreValidation.php:4
‪TYPO3\CMS\Extbase\Mvc\Cli\Request\setArgument
‪setArgument($argumentName, $value)
Definition: Request.php:193
‪TYPO3\CMS\Extbase\Mvc\Cli\Request\getArgument
‪string getArgument($argumentName)
Definition: Request.php:219
‪TYPO3\CMS\Extbase\Mvc\Cli\Request\setArguments
‪setArguments(array $arguments)
Definition: Request.php:207
‪TYPO3\CMS\Extbase\Mvc\Cli\Request\$controllerExtensionName
‪string $controllerExtensionName
Definition: Request.php:38
‪TYPO3\CMS\Extbase\Mvc\Cli\Request\$dispatched
‪bool $dispatched
Definition: Request.php:54
‪TYPO3
‪TYPO3\CMS\Extbase\Mvc\Cli\Request\getArguments
‪array getArguments()
Definition: Request.php:243
‪TYPO3\CMS\Extbase\Mvc\Cli\Request\$arguments
‪array $arguments
Definition: Request.php:44
‪TYPO3\CMS\Extbase\Mvc\Cli
Definition: Command.php:2
‪TYPO3\CMS\Extbase\Mvc\Cli\Request\getCallingScript
‪string getCallingScript()
Definition: Request.php:87
‪TYPO3\CMS\Extbase\Mvc\Cli\Request\getExceedingArguments
‪array getExceedingArguments()
Definition: Request.php:268
‪TYPO3\CMS\Extbase\Mvc\Cli\Request\$callingScript
‪string $callingScript
Definition: Request.php:66
‪TYPO3\CMS\Extbase\Mvc\Cli\Request
Definition: Request.php:23
‪TYPO3\CMS\Extbase\Mvc\Cli\Request\$commandLineArguments
‪array $commandLineArguments
Definition: Request.php:58
‪TYPO3\CMS\Extbase\Mvc\Cli\Request\$objectManager
‪TYPO3 CMS Extbase Object ObjectManagerInterface $objectManager
Definition: Request.php:26
‪TYPO3\CMS\Extbase\Mvc\Cli\Request\getControllerObjectName
‪string getControllerObjectName()
Definition: Request.php:135
‪TYPO3\CMS\Extbase\Mvc\Cli\Request\setExceedingArguments
‪setExceedingArguments(array $exceedingArguments)
Definition: Request.php:253
‪TYPO3\CMS\Core\Utility\ClassNamingUtility\explodeObjectControllerName
‪static array explodeObjectControllerName($controllerObjectName)
Definition: ClassNamingUtility.php:82
‪TYPO3\CMS\Extbase\Mvc\Cli\Request\getControllerCommandName
‪string getControllerCommandName()
Definition: Request.php:168
‪TYPO3\CMS\Extbase\Mvc\Cli\Request\getCommand
‪TYPO3 CMS Extbase Mvc Cli Command getCommand()
Definition: Request.php:178
‪TYPO3\CMS\Extbase\Mvc\Cli\Request\setControllerCommandName
‪setControllerCommandName($commandName)
Definition: Request.php:157
‪TYPO3\CMS\Extbase\Mvc\Cli\Request\$controllerCommandName
‪string $controllerCommandName
Definition: Request.php:34
‪TYPO3\CMS\Extbase\Mvc\Cli\Request\$exceedingArguments
‪array $exceedingArguments
Definition: Request.php:48
‪TYPO3\CMS\Extbase\Mvc\Cli\Request\setCallingScript
‪setCallingScript($callingScript)
Definition: Request.php:79
‪TYPO3\CMS\Extbase\Mvc\RequestInterface
Definition: RequestInterface.php:21
‪TYPO3\CMS\Extbase\Mvc\Cli\Request\$controllerObjectName
‪string $controllerObjectName
Definition: Request.php:30
‪TYPO3\CMS\Extbase\Mvc\Cli\Request\$command
‪TYPO3 CMS Extbase Mvc Cli Command $command
Definition: Request.php:62
‪TYPO3\CMS\Extbase\Mvc\Cli\Request\setDispatched
‪setDispatched($flag)
Definition: Request.php:97
‪TYPO3\CMS\Extbase\Mvc\Cli\Request\getControllerExtensionName
‪string getControllerExtensionName()
Definition: Request.php:145
‪TYPO3\CMS\Extbase\Mvc\Cli\Request\setControllerObjectName
‪setControllerObjectName($controllerObjectName)
Definition: Request.php:121
‪TYPO3\CMS\Extbase\Mvc\Cli\Request\hasArgument
‪bool hasArgument($argumentName)
Definition: Request.php:233