src/Sulu/Component/Content/Repository/ContentRepository.php
public function resolveInternalLinkContent(
        Row $row,
        $locale,
        $webspaceKey,
        MappingInterface $mapping,
        StructureType $type = null,
        UserInterface $user = null
    ) {
        $linkedContent = $this->find($row->getValue('internalLink'), $locale, $webspaceKey, $mapping);
        $data = $linkedContent->getData();

        // properties which are in the intersection of the data and non
        // fallback properties should be handled on the original row.
        $properties = array_intersect(self::$nonFallbackProperties, array_keys($data));
        foreach ($properties as $property) {
            $data[$property] = $this->resolveProperty($row, $property, $locale);
        }

        $content = new Content(
            $locale,
            $webspaceKey,
            $row->getValue('uuid'),
            $this->resolvePath($row, $webspaceKey),
            $row->getValue('state'),
            $row->getValue('nodeType'),
            $this->resolveHasChildren($row), $this->resolveProperty($row, 'template', $locale),
            $data,
            $this->resolvePermissions($row, $user),
            $type
        );

        if (!$content->getTemplate() || !$this->structureManager->getStructure($content->getTemplate())) {
            $content->setBrokenTemplate();
        }

        return $content;
    }
public function resolveInternalLinkContent(
        Row $row,
        $locale,
        $webspaceKey,
        MappingInterface $mapping,
        StructureType $type = null,
        UserInterface $user = null
    ) {
        $linkedContent = $this->find($row->getValue('internalLink'), $locale, $webspaceKey, $mapping);
        $data = $linkedContent->getData();

        // properties which are in the intersection of the data and non
        // fallback properties should be handled on the original row.
        $properties = array_intersect(self::$nonFallbackProperties, array_keys($data));
        foreach ($properties as $property) {
            $data[$property] = $this->resolveProperty($row, $property, $locale);
        }

        $content = new Content(
            $locale,
            $webspaceKey,
            $row->getValue('uuid'),
            $this->resolvePath($row, $webspaceKey),
            $row->getValue('state'),
            $row->getValue('nodeType'),
            $this->resolveHasChildren($row), $this->resolveProperty($row, 'template', $locale),
            $data,
            $this->resolvePermissions($row, $user),
            $type
        );

        if (!$content->getTemplate() || !$this->structureManager->getStructure($content->getTemplate())) {
            $content->setBrokenTemplate();
        }

        return $content;
    }
public function resolveInternalLinkContent ( Row $ row , $ locale , $ webspaceKey , MappingInterface $ mapping , StructureType $ type = null , UserInterface $ user = null ) { $ linkedContent = $ this -> find ( $ row -> getValue ( 'internalLink' ) , $ locale , $ webspaceKey , $ mapping ) ; $ data = $ linkedContent -> getData ( ) ; // properties which are in the intersection of the data and non // fallback properties should be handled on the original row. $ properties = array_intersect ( self :: $ nonFallbackProperties , array_keys ( $ data ) ) ; foreach ( $ properties as $ property ) { $ data [ $ property ] = $ this -> resolveProperty ( $ row , $ property , $ locale ) ; } $ content = new Content ( $ locale , $ webspaceKey , $ row -> getValue ( 'uuid' ) , $ this -> resolvePath ( $ row , $ webspaceKey ) , $ row -> getValue ( 'state' ) , $ row -> getValue ( 'nodeType' ) , $ this -> resolveHasChildren ( $ row ) , $ this -> resolveProperty ( $ row , 'template' , $ locale ) , $ data , $ this -> resolvePermissions ( $ row , $ user ) , $ type ) ; if ( ! $ content -> getTemplate ( ) || ! $ this -> structureManager -> getStructure ( $ content -> getTemplate ( ) ) ) { $ content -> setBrokenTemplate ( ) ; } return $ content ; }
Resolve a single result row which is an internal link to a content object.

@param Row $row
@param string $locale
@param string $webspaceKey
@param MappingInterface $mapping Includes array of property names
@param StructureType $type
@param UserInterface $user

@return Content
Resolve a single result row which is an internal link to a content object .