src/Sulu/Bundle/PageBundle/Command/WebspaceCopyCommand.php
protected function updateSmartContentStructure(
        array &$structureArray,
        PropertyMetadata $property,
        $localeSource,
        $localeDestination
    ) {
        /** @var PropertyParameter $parameter */
        foreach ($property->getParameters() as $parameter) {
            if (!array_key_exists($property->getName(), $structureArray)) {
                continue;
            }

            if ('provider' !== $parameter['name'] || 'content' !== $parameter['value']) {
                continue;
            }

            if (!array_key_exists('dataSource', $structureArray[$property->getName()])) {
                continue;
            }

            $targetDocumentDestination = $this->getTargetDocumentDestination(
                $structureArray[$property->getName()]['dataSource'],
                $localeSource,
                $localeDestination
            );

            if (!$targetDocumentDestination) {
                continue;
            }

            $structureArray[$property->getName()]['dataSource'] = $targetDocumentDestination->getUuid();
        }
    }
protected function updateSmartContentStructure(
        array &$structureArray,
        PropertyMetadata $property,
        $localeSource,
        $localeDestination
    ) {
        /** @var PropertyParameter $parameter */
        foreach ($property->getParameters() as $parameter) {
            if (!array_key_exists($property->getName(), $structureArray)) {
                continue;
            }

            if ('provider' !== $parameter['name'] || 'content' !== $parameter['value']) {
                continue;
            }

            if (!array_key_exists('dataSource', $structureArray[$property->getName()])) {
                continue;
            }

            $targetDocumentDestination = $this->getTargetDocumentDestination(
                $structureArray[$property->getName()]['dataSource'],
                $localeSource,
                $localeDestination
            );

            if (!$targetDocumentDestination) {
                continue;
            }

            $structureArray[$property->getName()]['dataSource'] = $targetDocumentDestination->getUuid();
        }
    }
protected function updateSmartContentStructure ( array & $ structureArray , PropertyMetadata $ property , $ localeSource , $ localeDestination ) { /** @var PropertyParameter $parameter */ foreach ( $ property -> getParameters ( ) as $ parameter ) { if ( ! array_key_exists ( $ property -> getName ( ) , $ structureArray ) ) { continue ; } if ( 'provider' !== $ parameter [ 'name' ] || 'content' !== $ parameter [ 'value' ] ) { continue ; } if ( ! array_key_exists ( 'dataSource' , $ structureArray [ $ property -> getName ( ) ] ) ) { continue ; } $ targetDocumentDestination = $ this -> getTargetDocumentDestination ( $ structureArray [ $ property -> getName ( ) ] [ 'dataSource' ] , $ localeSource , $ localeDestination ) ; if ( ! $ targetDocumentDestination ) { continue ; } $ structureArray [ $ property -> getName ( ) ] [ 'dataSource' ] = $ targetDocumentDestination -> getUuid ( ) ; } }
Updates the smart content structure when the property `dataSource` is set and the target is in the same webspace.

@param array $structureArray
@param PropertyMetadata $property
@param string $localeSource
@param string $localeDestination
Updates the smart content structure when the property dataSource is set and the target is in the same webspace .