src/Sulu/Component/Content/Export/WebspaceExport.php
protected function getDocumentsQueryString($webspaceKey, $uuid = null, $nodes = null, $ignoredNodes = null)
    {
        $where = [];

        // only pages
        $where[] = '([jcr:mixinTypes] = "sulu:page" OR [jcr:mixinTypes] = "sulu:home")';

        // filter by webspace key
        $where[] = sprintf(
            '(ISDESCENDANTNODE("/cmf/%s/contents") OR ISSAMENODE("/cmf/%s/contents"))',
            $webspaceKey,
            $webspaceKey
        );

        // filter by locale
        $where[] = sprintf(
            '[i18n:%s-template] IS NOT NULL',
            $this->exportLocale
        );

        // filter by uuid
        if ($uuid) {
            $where[] = sprintf('[jcr:uuid] = "%s"', $uuid);
        }

        $nodeWhere = $this->buildNodeUuidToPathWhere($nodes, false);

        if ($nodeWhere) {
            $where[] = $nodeWhere;
        }

        $ignoreWhere = $this->buildNodeUuidToPathWhere($ignoredNodes, true);
        if ($ignoreWhere) {
            $where[] = $ignoreWhere;
        }

        $queryString = 'SELECT * FROM [nt:unstructured] AS a WHERE ' . implode(' AND ', $where);

        return $queryString;
    }
protected function getDocumentsQueryString($webspaceKey, $uuid = null, $nodes = null, $ignoredNodes = null)
    {
        $where = [];

        // only pages
        $where[] = '([jcr:mixinTypes] = "sulu:page" OR [jcr:mixinTypes] = "sulu:home")';

        // filter by webspace key
        $where[] = sprintf(
            '(ISDESCENDANTNODE("/cmf/%s/contents") OR ISSAMENODE("/cmf/%s/contents"))',
            $webspaceKey,
            $webspaceKey
        );

        // filter by locale
        $where[] = sprintf(
            '[i18n:%s-template] IS NOT NULL',
            $this->exportLocale
        );

        // filter by uuid
        if ($uuid) {
            $where[] = sprintf('[jcr:uuid] = "%s"', $uuid);
        }

        $nodeWhere = $this->buildNodeUuidToPathWhere($nodes, false);

        if ($nodeWhere) {
            $where[] = $nodeWhere;
        }

        $ignoreWhere = $this->buildNodeUuidToPathWhere($ignoredNodes, true);
        if ($ignoreWhere) {
            $where[] = $ignoreWhere;
        }

        $queryString = 'SELECT * FROM [nt:unstructured] AS a WHERE ' . implode(' AND ', $where);

        return $queryString;
    }
protected function getDocumentsQueryString ( $ webspaceKey , $ uuid = null , $ nodes = null , $ ignoredNodes = null ) { $ where = [ ] ; // only pages $ where [ ] = '([jcr:mixinTypes] = "sulu:page" OR [jcr:mixinTypes] = "sulu:home")' ; // filter by webspace key $ where [ ] = sprintf ( '(ISDESCENDANTNODE("/cmf/%s/contents") OR ISSAMENODE("/cmf/%s/contents"))' , $ webspaceKey , $ webspaceKey ) ; // filter by locale $ where [ ] = sprintf ( '[i18n:%s-template] IS NOT NULL' , $ this -> exportLocale ) ; // filter by uuid if ( $ uuid ) { $ where [ ] = sprintf ( '[jcr:uuid] = "%s"' , $ uuid ) ; } $ nodeWhere = $ this -> buildNodeUuidToPathWhere ( $ nodes , false ) ; if ( $ nodeWhere ) { $ where [ ] = $ nodeWhere ; } $ ignoreWhere = $ this -> buildNodeUuidToPathWhere ( $ ignoredNodes , true ) ; if ( $ ignoreWhere ) { $ where [ ] = $ ignoreWhere ; } $ queryString = 'SELECT * FROM [nt:unstructured] AS a WHERE ' . implode ( ' AND ' , $ where ) ; return $ queryString ; }
Create the query to get all documents from given webspace and language.

@param string $webspaceKey
@param string $uuid
@param array $nodes
@param array $ignoredNodes

@return string

@throws DocumentManagerException
Create the query to get all documents from given webspace and language .