Command/ReindexCommand.php
protected function getDocuments($locale)
    {
        $propertyEncoder = $this->getContainer()->get('sulu_document_manager.property_encoder');
        $documentManager = $this->getContainer()->get('sulu_document_manager.document_manager');

        $sql2 = sprintf(
            'SELECT * FROM [nt:unstructured] AS a WHERE [jcr:mixinTypes] = "sulu:article" AND [%s] IS NOT NULL',
            $propertyEncoder->localizedSystemName('template', $locale)
        );

        return $documentManager->createQuery($sql2, $locale, ['load_ghost_content' => false])->execute();
    }
protected function getDocuments($locale)
    {
        $propertyEncoder = $this->getContainer()->get('sulu_document_manager.property_encoder');
        $documentManager = $this->getContainer()->get('sulu_document_manager.document_manager');

        $sql2 = sprintf(
            'SELECT * FROM [nt:unstructured] AS a WHERE [jcr:mixinTypes] = "sulu:article" AND [%s] IS NOT NULL',
            $propertyEncoder->localizedSystemName('template', $locale)
        );

        return $documentManager->createQuery($sql2, $locale, ['load_ghost_content' => false])->execute();
    }
protected function getDocuments ( $ locale ) { $ propertyEncoder = $ this -> getContainer ( ) -> get ( 'sulu_document_manager.property_encoder' ) ; $ documentManager = $ this -> getContainer ( ) -> get ( 'sulu_document_manager.document_manager' ) ; $ sql2 = sprintf ( 'SELECT * FROM [nt:unstructured] AS a WHERE [jcr:mixinTypes] = "sulu:article" AND [%s] IS NOT NULL' , $ propertyEncoder -> localizedSystemName ( 'template' , $ locale ) ) ; return $ documentManager -> createQuery ( $ sql2 , $ locale , [ 'load_ghost_content' => false ] ) -> execute ( ) ; }
Query for documents with given locale.

@param string $locale

@return QueryResultInterface
Query for documents with given locale .