protected function storeViewDataLegacy()
    {
        $originalArguments = [];

        $variableProvider = $this->getVariableProvider();

        foreach (self::$reservedVariablesNames as $key) {
            if ($variableProvider->exists($key)) {
                $originalArguments[$key] = $variableProvider->get($key);
            }
        }

        $viewHelperVariableContainer = $this->renderingContext->getViewHelperVariableContainer();
        $currentView = $viewHelperVariableContainer->getView();

        return function (array $templateArguments) use ($originalArguments, $variableProvider, $viewHelperVariableContainer, $currentView) {
            $viewHelperVariableContainer->setView($currentView);

            /*
             * Cleaning up the variables in the provider: the original
             * values are restored to make the provider like it was before
             * the field rendering started.
             */
            foreach ($variableProvider->getAllIdentifiers() as $identifier) {
                if (array_key_exists($identifier, $templateArguments)) {
                    $variableProvider->remove($identifier);
                }
            }

            foreach ($originalArguments as $key => $value) {
                if ($variableProvider->exists($key)) {
                    $variableProvider->remove($key);
                }

                $variableProvider->add($key, $value);
            }
        };
    }
protected function storeViewDataLegacy()
    {
        $originalArguments = [];

        $variableProvider = $this->getVariableProvider();

        foreach (self::$reservedVariablesNames as $key) {
            if ($variableProvider->exists($key)) {
                $originalArguments[$key] = $variableProvider->get($key);
            }
        }

        $viewHelperVariableContainer = $this->renderingContext->getViewHelperVariableContainer();
        $currentView = $viewHelperVariableContainer->getView();

        return function (array $templateArguments) use ($originalArguments, $variableProvider, $viewHelperVariableContainer, $currentView) {
            $viewHelperVariableContainer->setView($currentView);

            /*
             * Cleaning up the variables in the provider: the original
             * values are restored to make the provider like it was before
             * the field rendering started.
             */
            foreach ($variableProvider->getAllIdentifiers() as $identifier) {
                if (array_key_exists($identifier, $templateArguments)) {
                    $variableProvider->remove($identifier);
                }
            }

            foreach ($originalArguments as $key => $value) {
                if ($variableProvider->exists($key)) {
                    $variableProvider->remove($key);
                }

                $variableProvider->add($key, $value);
            }
        };
    }
protected function storeViewDataLegacy ( ) { $ originalArguments = [ ] ; $ variableProvider = $ this -> getVariableProvider ( ) ; foreach ( self :: $ reservedVariablesNames as $ key ) { if ( $ variableProvider -> exists ( $ key ) ) { $ originalArguments [ $ key ] = $ variableProvider -> get ( $ key ) ; } } $ viewHelperVariableContainer = $ this -> renderingContext -> getViewHelperVariableContainer ( ) ; $ currentView = $ viewHelperVariableContainer -> getView ( ) ; return function ( array $ templateArguments ) use ( $ originalArguments , $ variableProvider , $ viewHelperVariableContainer , $ currentView ) { $ viewHelperVariableContainer -> setView ( $ currentView ) ; /*
             * Cleaning up the variables in the provider: the original
             * values are restored to make the provider like it was before
             * the field rendering started.
             */ foreach ( $ variableProvider -> getAllIdentifiers ( ) as $ identifier ) { if ( array_key_exists ( $ identifier , $ templateArguments ) ) { $ variableProvider -> remove ( $ identifier ) ; } } foreach ( $ originalArguments as $ key => $ value ) { if ( $ variableProvider -> exists ( $ key ) ) { $ variableProvider -> remove ( $ key ) ; } $ variableProvider -> add ( $ key , $ value ) ; } } ; }
Temporary solution for TYPO3 6.2 to 7.6 that will store the current view
variables, to be able to restore them later.

A callback function is returned; it will be called once the field layout
view was processed, and will restore all the view data.

@return \Closure

@deprecated Will be deleted when TYPO3 7.6 is not supported anymore.
Temporary solution for TYPO3 6 . 2 to 7 . 6 that will store the current view variables to be able to restore them later .