/**
  * Maps arguments delivered by the request object to the local controller arguments.
  *
  * @return void
  */
 protected function mapRequestArgumentsToControllerArguments()
 {
     foreach ($this->arguments as $argument) {
         $argumentName = $argument->getName();
         if ($this->request->hasArgument($argumentName)) {
             $argument->setValue($this->request->getArgument($argumentName));
         } elseif ($argument->isRequired()) {
             $exception = new \TYPO3\CMS\Extbase\Mvc\Exception\CommandException('Required argument "' . $argumentName . '" is not set.', 1306755520);
             $this->forward('error', 'TYPO3\\CMS\\Extbase\\Command\\HelpCommandController', array('exception' => $exception));
         }
     }
 }
 /**
  * Maps arguments delivered by the request object to the local controller arguments.
  *
  * @return void
  */
 protected function mapRequestArgumentsToControllerArguments()
 {
     foreach ($this->arguments as $argument) {
         $argumentName = $argument->getName();
         if ($this->request->hasArgument($argumentName)) {
             $argument->setValue($this->request->getArgument($argumentName));
         } elseif ($argument->isRequired()) {
             $commandArgumentDefinition = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Mvc\\Cli\\CommandArgumentDefinition', $argumentName, TRUE, NULL);
             $exception = new \TYPO3\CMS\Extbase\Mvc\Exception\CommandException('Required argument "' . $commandArgumentDefinition->getDashedName() . '" is not set.', 1306755520);
             $this->forward('error', 'TYPO3\\CMS\\Extbase\\Command\\HelpCommandController', array('exception' => $exception));
         }
     }
 }
Beispiel #3
0
 /**
  * Maps arguments delivered by the request object to the local controller arguments.
  *
  * @return void
  */
 protected function mapRequestArgumentsToControllerArguments()
 {
     /** @var Argument $argument */
     foreach ($this->arguments as $argument) {
         $argumentName = $argument->getName();
         if ($this->request->hasArgument($argumentName)) {
             $argument->setValue($this->request->getArgument($argumentName));
             continue;
         }
         if (!$argument->isRequired()) {
             continue;
         }
         $argumentValue = null;
         $commandArgumentDefinition = $this->objectManager->get(CommandArgumentDefinition::class, $argumentName, true, null);
         while ($argumentValue === null) {
             $argumentValue = $this->output->ask(sprintf('<comment>Please specify the required argument "%s":</comment> ', $commandArgumentDefinition->getDashedName()));
         }
         $argument->setValue($argumentValue);
     }
 }
 /**
  * Maps arguments delivered by the request object to the local controller arguments.
  *
  * @return void
  */
 protected function mapRequestArgumentsToControllerArguments()
 {
     /** @var Argument $argument */
     foreach ($this->arguments as $argument) {
         $argumentName = $argument->getName();
         if ($this->request->hasArgument($argumentName)) {
             $argument->setValue($this->request->getArgument($argumentName));
             continue;
         }
         if (!$argument->isRequired()) {
             continue;
         }
         $argumentValue = NULL;
         $commandArgumentDefinition = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Mvc\\Cli\\CommandArgumentDefinition', $argumentName, TRUE, NULL);
         while ($argumentValue === NULL) {
             $argumentValue = $this->output->ask(sprintf('<comment>Please specify the required argument "%s":</comment> ', $commandArgumentDefinition->getDashedName()));
         }
         $argument->setValue($argumentValue);
     }
 }