/** * Implementation of the arguments initialization in the action controller: * Automatically registers arguments of the current action * * Don't override this method - use initializeAction() instead. * * @return void * @throws \TYPO3\Flow\Mvc\Exception\InvalidArgumentTypeException * @see initializeArguments() */ public function initializeActionMethodArguments() { \TYPO3\Flow\Mvc\Controller\RestController::initializeActionMethodArguments(); }
/** * The content of the root request is used as resource argument. * * @return void * @throws \TYPO3\Flow\Mvc\Exception\InvalidArgumentTypeException * @see initializeArguments() */ protected function initializeActionMethodArguments() { if ($this->request->__previousControllerActionName === 'index') { switch ($this->request->getHttpRequest()->getMethod()) { case 'POST': case 'PUT': $arguments = $this->request->getArguments(); if (!isset($arguments[$this->resourceArgumentName])) { $arguments[$this->resourceArgumentName] = []; } $arguments[$this->resourceArgumentName] = array_merge_recursive($arguments[$this->resourceArgumentName], $this->extractRequestBody()); $this->request->setArguments($arguments); break; } } parent::initializeActionMethodArguments(); }