Bundle/ViewReferenceBundle/Connector/ViewReferenceManager.php
public function saveReference(ViewReference $viewReference, $parentId = null, $parentLocale = null)
    {
        // Transform the viewReference in array
        $arrayTransformer = $this->transformer->getViewReferenceTransformer(
            $viewReference->getViewNamespace(), 'array'
        );
        $referenceArray = $arrayTransformer->reverseTransform($viewReference);
        // Remove old url if exist
        $this->removeUrlForViewReference($viewReference);
        // Update/create the viewReference
        $this->manager->update($referenceArray['id'], $referenceArray);
        // Build the url for reference
        $this->manager->buildUrl($viewReference->getId());
        // Set parent if exist
        if ($parentId && $parentLocale === $viewReference->getLocale()) {
            $this->manager->addChild($parentId, $referenceArray['id']);
        }

        return $referenceArray['id'];
    }
public function saveReference(ViewReference $viewReference, $parentId = null, $parentLocale = null)
    {
        // Transform the viewReference in array
        $arrayTransformer = $this->transformer->getViewReferenceTransformer(
            $viewReference->getViewNamespace(), 'array'
        );
        $referenceArray = $arrayTransformer->reverseTransform($viewReference);
        // Remove old url if exist
        $this->removeUrlForViewReference($viewReference);
        // Update/create the viewReference
        $this->manager->update($referenceArray['id'], $referenceArray);
        // Build the url for reference
        $this->manager->buildUrl($viewReference->getId());
        // Set parent if exist
        if ($parentId && $parentLocale === $viewReference->getLocale()) {
            $this->manager->addChild($parentId, $referenceArray['id']);
        }

        return $referenceArray['id'];
    }
public function saveReference ( ViewReference $ viewReference , $ parentId = null , $ parentLocale = null ) { // Transform the viewReference in array $ arrayTransformer = $ this -> transformer -> getViewReferenceTransformer ( $ viewReference -> getViewNamespace ( ) , 'array' ) ; $ referenceArray = $ arrayTransformer -> reverseTransform ( $ viewReference ) ; // Remove old url if exist $ this -> removeUrlForViewReference ( $ viewReference ) ; // Update/create the viewReference $ this -> manager -> update ( $ referenceArray [ 'id' ] , $ referenceArray ) ; // Build the url for reference $ this -> manager -> buildUrl ( $ viewReference -> getId ( ) ) ; // Set parent if exist if ( $ parentId && $ parentLocale === $ viewReference -> getLocale ( ) ) { $ this -> manager -> addChild ( $ parentId , $ referenceArray [ 'id' ] ) ; } return $ referenceArray [ 'id' ] ; }
This method save a Reference.

@param ViewReference $viewReference
@param string        $parentId
@param string        $parentLocale

@return mixed
This method save a Reference .