PageTree/PageTreeRepository.php
private function findLinkedArticles($field, $value, $locale)
    {
        $where = [];
        foreach ($this->metadataFactory->getStructures('article') as $metadata) {
            $property = $this->getRoutePathPropertyName($metadata);
            if (null === $property || PageTreeRouteContentType::NAME !== $property->getType()) {
                continue;
            }

            $where[] = sprintf(
                '([%s] = "%s" AND [%s-%s] = "%s")',
                $this->propertyEncoder->localizedSystemName('template', $locale),
                $metadata->getName(),
                $this->propertyEncoder->localizedContentName($property->getName(), $locale),
                $field,
                $value
            );
        }

        if (0 === count($where)) {
            return [];
        }

        $query = $this->documentManager->createQuery(
            sprintf(
                'SELECT * FROM [nt:unstructured] WHERE [jcr:mixinTypes] = "sulu:article" AND (%s)',
                implode(' OR ', $where)
            ),
            $locale
        );

        return $query->execute();
    }
private function findLinkedArticles($field, $value, $locale)
    {
        $where = [];
        foreach ($this->metadataFactory->getStructures('article') as $metadata) {
            $property = $this->getRoutePathPropertyName($metadata);
            if (null === $property || PageTreeRouteContentType::NAME !== $property->getType()) {
                continue;
            }

            $where[] = sprintf(
                '([%s] = "%s" AND [%s-%s] = "%s")',
                $this->propertyEncoder->localizedSystemName('template', $locale),
                $metadata->getName(),
                $this->propertyEncoder->localizedContentName($property->getName(), $locale),
                $field,
                $value
            );
        }

        if (0 === count($where)) {
            return [];
        }

        $query = $this->documentManager->createQuery(
            sprintf(
                'SELECT * FROM [nt:unstructured] WHERE [jcr:mixinTypes] = "sulu:article" AND (%s)',
                implode(' OR ', $where)
            ),
            $locale
        );

        return $query->execute();
    }
private function findLinkedArticles ( $ field , $ value , $ locale ) { $ where = [ ] ; foreach ( $ this -> metadataFactory -> getStructures ( 'article' ) as $ metadata ) { $ property = $ this -> getRoutePathPropertyName ( $ metadata ) ; if ( null === $ property || PageTreeRouteContentType :: NAME !== $ property -> getType ( ) ) { continue ; } $ where [ ] = sprintf ( '([%s] = "%s" AND [%s-%s] = "%s")' , $ this -> propertyEncoder -> localizedSystemName ( 'template' , $ locale ) , $ metadata -> getName ( ) , $ this -> propertyEncoder -> localizedContentName ( $ property -> getName ( ) , $ locale ) , $ field , $ value ) ; } if ( 0 === count ( $ where ) ) { return [ ] ; } $ query = $ this -> documentManager -> createQuery ( sprintf ( 'SELECT * FROM [nt:unstructured] WHERE [jcr:mixinTypes] = "sulu:article" AND (%s)' , implode ( ' OR ' , $ where ) ) , $ locale ) ; return $ query -> execute ( ) ; }
Find articles linked to the given page.

@param string $field
@param string $value
@param string $locale

@return ArticleInterface[]
Find articles linked to the given page .