Neos\Flow\Mvc\Controller\MvcPropertyMappingConfigurationService::initializePropertyMappingConfigurationFromRequest PHP Method

initializePropertyMappingConfigurationFromRequest() public method

Initialize the property mapping configuration in $controllerArguments if the trusted properties are set inside the request.
public initializePropertyMappingConfigurationFromRequest ( ActionRequest $request, Arguments $controllerArguments ) : void
$request Neos\Flow\Mvc\ActionRequest
$controllerArguments Arguments
return void
    public function initializePropertyMappingConfigurationFromRequest(ActionRequest $request, Arguments $controllerArguments)
    {
        $trustedPropertiesToken = $request->getInternalArgument('__trustedProperties');
        if (!is_string($trustedPropertiesToken)) {
            return;
        }
        $serializedTrustedProperties = $this->hashService->validateAndStripHmac($trustedPropertiesToken);
        $trustedProperties = unserialize($serializedTrustedProperties);
        foreach ($trustedProperties as $propertyName => $propertyConfiguration) {
            if (!$controllerArguments->hasArgument($propertyName)) {
                continue;
            }
            $propertyMappingConfiguration = $controllerArguments->getArgument($propertyName)->getPropertyMappingConfiguration();
            $this->modifyPropertyMappingConfiguration($propertyConfiguration, $propertyMappingConfiguration);
        }
    }

Usage Example

Example #1
0
 /**
  * Handles a request. The result output is returned by altering the given response.
  *
  * @param RequestInterface $request The request object
  * @param ResponseInterface $response The response, modified by this handler
  * @return void
  * @throws UnsupportedRequestTypeException
  * @api
  */
 public function processRequest(RequestInterface $request, ResponseInterface $response)
 {
     $this->initializeController($request, $response);
     $this->actionMethodName = $this->resolveActionMethodName();
     $this->initializeActionMethodArguments();
     $this->initializeActionMethodValidators();
     $this->initializeAction();
     $actionInitializationMethodName = 'initialize' . ucfirst($this->actionMethodName);
     if (method_exists($this, $actionInitializationMethodName)) {
         call_user_func([$this, $actionInitializationMethodName]);
     }
     $this->mvcPropertyMappingConfigurationService->initializePropertyMappingConfigurationFromRequest($this->request, $this->arguments);
     $this->mapRequestArgumentsToControllerArguments();
     if ($this->view === null) {
         $this->view = $this->resolveView();
     }
     if ($this->view !== null) {
         $this->view->assign('settings', $this->settings);
         $this->view->setControllerContext($this->controllerContext);
         $this->initializeView($this->view);
     }
     $this->callActionMethod();
 }
All Usage Examples Of Neos\Flow\Mvc\Controller\MvcPropertyMappingConfigurationService::initializePropertyMappingConfigurationFromRequest