src/Sulu/Bundle/PageBundle/Resources/phpcr-migrations/Version201511240844.php
private function upgradeBlockProperty(
        BlockMetadata $blockProperty,
        array $components,
        PropertyValue $propertyValue,
        $addScheme
    ) {
        $componentNames = array_map(
            function($item) {
                return $item['component']->getName();
            },
            $components
        );

        $value = $propertyValue->getValue();
        foreach ($value as &$item) {
            if (!in_array($item['type'], $componentNames)) {
                continue;
            }

            foreach ($components[$item['type']]['children'] as $child) {
                if (!isset($item[$child->getName()])) {
                    continue;
                }

                if ($addScheme) {
                    $item[$child->getName()] = $this->upgradeUrl($item[$child->getName()]);
                } else {
                    $item[$child->getName()] = $this->downgradeUrl($item[$child->getName()]);
                }
            }
        }

        $propertyValue->setValue($value);
    }
private function upgradeBlockProperty(
        BlockMetadata $blockProperty,
        array $components,
        PropertyValue $propertyValue,
        $addScheme
    ) {
        $componentNames = array_map(
            function($item) {
                return $item['component']->getName();
            },
            $components
        );

        $value = $propertyValue->getValue();
        foreach ($value as &$item) {
            if (!in_array($item['type'], $componentNames)) {
                continue;
            }

            foreach ($components[$item['type']]['children'] as $child) {
                if (!isset($item[$child->getName()])) {
                    continue;
                }

                if ($addScheme) {
                    $item[$child->getName()] = $this->upgradeUrl($item[$child->getName()]);
                } else {
                    $item[$child->getName()] = $this->downgradeUrl($item[$child->getName()]);
                }
            }
        }

        $propertyValue->setValue($value);
    }
private function upgradeBlockProperty ( BlockMetadata $ blockProperty , array $ components , PropertyValue $ propertyValue , $ addScheme ) { $ componentNames = array_map ( function ( $ item ) { return $ item [ 'component' ] -> getName ( ) ; } , $ components ) ; $ value = $ propertyValue -> getValue ( ) ; foreach ( $ value as & $ item ) { if ( ! in_array ( $ item [ 'type' ] , $ componentNames ) ) { continue ; } foreach ( $ components [ $ item [ 'type' ] ] [ 'children' ] as $ child ) { if ( ! isset ( $ item [ $ child -> getName ( ) ] ) ) { continue ; } if ( $ addScheme ) { $ item [ $ child -> getName ( ) ] = $ this -> upgradeUrl ( $ item [ $ child -> getName ( ) ] ) ; } else { $ item [ $ child -> getName ( ) ] = $ this -> downgradeUrl ( $ item [ $ child -> getName ( ) ] ) ; } } } $ propertyValue -> setValue ( $ value ) ; }
Upgrades the given block property to the new URL representation.

@param BlockMetadata $blockProperty
@param array $components
@param PropertyValue $propertyValue
@param bool $addScheme
Upgrades the given block property to the new URL representation .