Bundle/ViewReferenceBundle/Connector/ViewReferenceManager.php
public function saveReferences(array $viewReferences, $parentId = null, $parentLocale = null, $reset = true)
    {
        // Reset redis if wanted
        if ($reset) {
            $this->manager->reset();
        }

        // Parse the viewReferences
        foreach ($viewReferences as $viewReference) {
            /** @var View $view */
            $view = $viewReference['view'];
            foreach ($view->getReferences() as $locale => $reference) {
                if ($reference !== null) {
                    // save the viewReference
                    $id = $this->saveReference($reference, $parentId, $parentLocale);
                    // if children, save them
                    if (array_key_exists('children', $viewReference) && !empty($children = $viewReference['children'])) {
                        $this->saveReferences($children, $id, $reference->getLocale(), false);
                    }
                }
            }
        }
    }
public function saveReferences(array $viewReferences, $parentId = null, $parentLocale = null, $reset = true)
    {
        // Reset redis if wanted
        if ($reset) {
            $this->manager->reset();
        }

        // Parse the viewReferences
        foreach ($viewReferences as $viewReference) {
            /** @var View $view */
            $view = $viewReference['view'];
            foreach ($view->getReferences() as $locale => $reference) {
                if ($reference !== null) {
                    // save the viewReference
                    $id = $this->saveReference($reference, $parentId, $parentLocale);
                    // if children, save them
                    if (array_key_exists('children', $viewReference) && !empty($children = $viewReference['children'])) {
                        $this->saveReferences($children, $id, $reference->getLocale(), false);
                    }
                }
            }
        }
    }
public function saveReferences ( array $ viewReferences , $ parentId = null , $ parentLocale = null , $ reset = true ) { // Reset redis if wanted if ( $ reset ) { $ this -> manager -> reset ( ) ; } // Parse the viewReferences foreach ( $ viewReferences as $ viewReference ) { /** @var View $view */ $ view = $ viewReference [ 'view' ] ; foreach ( $ view -> getReferences ( ) as $ locale => $ reference ) { if ( $ reference !== null ) { // save the viewReference $ id = $ this -> saveReference ( $ reference , $ parentId , $ parentLocale ) ; // if children, save them if ( array_key_exists ( 'children' , $ viewReference ) && ! empty ( $ children = $ viewReference [ 'children' ] ) ) { $ this -> saveReferences ( $ children , $ id , $ reference -> getLocale ( ) , false ) ; } } } } }
This method save a tree of viewReferences.

@param array  $viewReferences
@param string $parentId
@param string $parentLocale
@param bool   $reset
This method save a tree of viewReferences .