src/Sulu/Bundle/PageBundle/Resources/phpcr-migrations/Version201511240844.php
private function upgradeNode(NodeInterface $node, $locale, array $properties, $addScheme)
    {
        /** @var BasePageDocument $document */
        $document = $this->documentManager->find($node->getIdentifier(), $locale);
        $documentLocales = $this->documentInspector->getLocales($document);

        if (!in_array($locale, $documentLocales)) {
            return;
        }

        foreach ($properties as $property) {
            $propertyValue = $document->getStructure()->getProperty($property['property']->getName());

            if ($property['property'] instanceof BlockMetadata) {
                $this->upgradeBlockProperty($property['property'], $property['components'], $propertyValue, $addScheme);
            } else {
                $this->upgradeProperty($propertyValue, $addScheme);
            }
        }

        $this->documentManager->persist($document, $locale, ['auto_name' => false]);
    }
private function upgradeNode(NodeInterface $node, $locale, array $properties, $addScheme)
    {
        /** @var BasePageDocument $document */
        $document = $this->documentManager->find($node->getIdentifier(), $locale);
        $documentLocales = $this->documentInspector->getLocales($document);

        if (!in_array($locale, $documentLocales)) {
            return;
        }

        foreach ($properties as $property) {
            $propertyValue = $document->getStructure()->getProperty($property['property']->getName());

            if ($property['property'] instanceof BlockMetadata) {
                $this->upgradeBlockProperty($property['property'], $property['components'], $propertyValue, $addScheme);
            } else {
                $this->upgradeProperty($propertyValue, $addScheme);
            }
        }

        $this->documentManager->persist($document, $locale, ['auto_name' => false]);
    }
private function upgradeNode ( NodeInterface $ node , $ locale , array $ properties , $ addScheme ) { /** @var BasePageDocument $document */ $ document = $ this -> documentManager -> find ( $ node -> getIdentifier ( ) , $ locale ) ; $ documentLocales = $ this -> documentInspector -> getLocales ( $ document ) ; if ( ! in_array ( $ locale , $ documentLocales ) ) { return ; } foreach ( $ properties as $ property ) { $ propertyValue = $ document -> getStructure ( ) -> getProperty ( $ property [ 'property' ] -> getName ( ) ) ; if ( $ property [ 'property' ] instanceof BlockMetadata ) { $ this -> upgradeBlockProperty ( $ property [ 'property' ] , $ property [ 'components' ] , $ propertyValue , $ addScheme ) ; } else { $ this -> upgradeProperty ( $ propertyValue , $ addScheme ) ; } } $ this -> documentManager -> persist ( $ document , $ locale , [ 'auto_name' => false ] ) ; }
Upgrades the node to new URL representation.

@param NodeInterface $node The node to be upgraded
@param string $locale The locale of the node to be upgraded
@param array $properties The properties which are or contain URL fields
@param bool $addScheme Adds the scheme to URLs if true, removes the scheme otherwise
Upgrades the node to new URL representation .