Neos\FluidAdaptor\Core\Widget\AjaxWidgetContextHolder::store PHP Method

store() public method

Stores the WidgetContext inside the Context, and sets the AjaxWidgetIdentifier inside the Widget Context correctly.
public store ( WidgetContext $widgetContext ) : void
$widgetContext WidgetContext
return void
    public function store(WidgetContext $widgetContext)
    {
        $ajaxWidgetId = $this->nextFreeAjaxWidgetId++;
        $widgetContext->setAjaxWidgetIdentifier($ajaxWidgetId);
        $this->widgetContexts[$ajaxWidgetId] = $widgetContext;
    }

Usage Example

 /**
  * Initialize the Widget Context, before the Render method is called.
  *
  * @return void
  */
 private function initializeWidgetContext()
 {
     if ($this->ajaxWidget === true) {
         if ($this->storeConfigurationInSession === true) {
             $this->ajaxWidgetContextHolder->store($this->widgetContext);
         }
         $this->widgetContext->setAjaxWidgetConfiguration($this->getAjaxWidgetConfiguration());
     }
     $this->widgetContext->setNonAjaxWidgetConfiguration($this->getNonAjaxWidgetConfiguration());
     $this->initializeWidgetIdentifier();
     $controllerObjectName = $this->controller instanceof DependencyProxy ? $this->controller->_getClassName() : get_class($this->controller);
     $this->widgetContext->setControllerObjectName($controllerObjectName);
 }
AjaxWidgetContextHolder