protected function collectContentDataFromPages(
        $shortcutItem,
        &$collectedItems,
        $recursive = 0,
        $parentUid = 0,
        $language = 0
    ) {
        $itemList = str_replace('pages_', '', $shortcutItem);
        if ($recursive) {
            if (!$this->tree instanceof QueryGenerator) {
                $this->tree = GeneralUtility::makeInstance(QueryGenerator::class);
            }
            $itemList = $this->tree->getTreeList($itemList, (int)$recursive, 0, 1);
        }
        $itemList = GeneralUtility::intExplode(',', $itemList);

        $queryBuilder = $this->getQueryBuilder();

        $items = $queryBuilder
            ->select('*')
            ->addSelectLiteral($queryBuilder->expr()->inSet(
                'pid',
                    $queryBuilder->createNamedParameter($itemList, Connection::PARAM_INT_ARRAY)
            ) . ' AS inSet')
            ->from('tt_content')
            ->where(
                $queryBuilder->expr()->neq(
                    'uid',
                    $queryBuilder->createNamedParameter((int)$parentUid, \PDO::PARAM_INT)
                ),
                $queryBuilder->expr()->in(
                    'pid',
                    $queryBuilder->createNamedParameter($itemList, Connection::PARAM_INT_ARRAY)
                ),
                $queryBuilder->expr()->gte('colPos', $queryBuilder->createNamedParameter(0, \PDO::PARAM_INT)),
                $queryBuilder->expr()->in(
                    'sys_language_uid',
                    $queryBuilder->createNamedParameter([0, -1], Connection::PARAM_INT_ARRAY)
                )
            )
            ->orderBy('inSet')
            ->addOrderBy('colPos')
            ->addOrderBy('sorting')
            ->execute()
            ->fetchAll();

        foreach ($items as $item) {
            if (!empty($this->extentensionConfiguration['overlayShortcutTranslation']) && $language > 0) {
                $translatedItem = BackendUtility::getRecordLocalization('tt_content', $item['uid'], $language);
                if (!empty($translatedItem)) {
                    $item = array_shift($translatedItem);
                }
            }
            if ($this->helper->getBackendUser()->workspace > 0) {
                BackendUtility::workspaceOL('tt_content', $item, $this->helper->getBackendUser()->workspace);
            }
            $item['tx_gridelements_reference_container'] = $item['pid'];
            $collectedItems[] = $item;
        }
    }
protected function collectContentDataFromPages(
        $shortcutItem,
        &$collectedItems,
        $recursive = 0,
        $parentUid = 0,
        $language = 0
    ) {
        $itemList = str_replace('pages_', '', $shortcutItem);
        if ($recursive) {
            if (!$this->tree instanceof QueryGenerator) {
                $this->tree = GeneralUtility::makeInstance(QueryGenerator::class);
            }
            $itemList = $this->tree->getTreeList($itemList, (int)$recursive, 0, 1);
        }
        $itemList = GeneralUtility::intExplode(',', $itemList);

        $queryBuilder = $this->getQueryBuilder();

        $items = $queryBuilder
            ->select('*')
            ->addSelectLiteral($queryBuilder->expr()->inSet(
                'pid',
                    $queryBuilder->createNamedParameter($itemList, Connection::PARAM_INT_ARRAY)
            ) . ' AS inSet')
            ->from('tt_content')
            ->where(
                $queryBuilder->expr()->neq(
                    'uid',
                    $queryBuilder->createNamedParameter((int)$parentUid, \PDO::PARAM_INT)
                ),
                $queryBuilder->expr()->in(
                    'pid',
                    $queryBuilder->createNamedParameter($itemList, Connection::PARAM_INT_ARRAY)
                ),
                $queryBuilder->expr()->gte('colPos', $queryBuilder->createNamedParameter(0, \PDO::PARAM_INT)),
                $queryBuilder->expr()->in(
                    'sys_language_uid',
                    $queryBuilder->createNamedParameter([0, -1], Connection::PARAM_INT_ARRAY)
                )
            )
            ->orderBy('inSet')
            ->addOrderBy('colPos')
            ->addOrderBy('sorting')
            ->execute()
            ->fetchAll();

        foreach ($items as $item) {
            if (!empty($this->extentensionConfiguration['overlayShortcutTranslation']) && $language > 0) {
                $translatedItem = BackendUtility::getRecordLocalization('tt_content', $item['uid'], $language);
                if (!empty($translatedItem)) {
                    $item = array_shift($translatedItem);
                }
            }
            if ($this->helper->getBackendUser()->workspace > 0) {
                BackendUtility::workspaceOL('tt_content', $item, $this->helper->getBackendUser()->workspace);
            }
            $item['tx_gridelements_reference_container'] = $item['pid'];
            $collectedItems[] = $item;
        }
    }
protected function collectContentDataFromPages ( $ shortcutItem , & $ collectedItems , $ recursive = 0 , $ parentUid = 0 , $ language = 0 ) { $ itemList = str_replace ( 'pages_' , '' , $ shortcutItem ) ; if ( $ recursive ) { if ( ! $ this -> tree instanceof QueryGenerator ) { $ this -> tree = GeneralUtility :: makeInstance ( QueryGenerator :: class ) ; } $ itemList = $ this -> tree -> getTreeList ( $ itemList , ( int ) $ recursive , 0 , 1 ) ; } $ itemList = GeneralUtility :: intExplode ( ',' , $ itemList ) ; $ queryBuilder = $ this -> getQueryBuilder ( ) ; $ items = $ queryBuilder -> select ( '*' ) -> addSelectLiteral ( $ queryBuilder -> expr ( ) -> inSet ( 'pid' , $ queryBuilder -> createNamedParameter ( $ itemList , Connection :: PARAM_INT_ARRAY ) ) . ' AS inSet' ) -> from ( 'tt_content' ) -> where ( $ queryBuilder -> expr ( ) -> neq ( 'uid' , $ queryBuilder -> createNamedParameter ( ( int ) $ parentUid , \ PDO :: PARAM_INT ) ) , $ queryBuilder -> expr ( ) -> in ( 'pid' , $ queryBuilder -> createNamedParameter ( $ itemList , Connection :: PARAM_INT_ARRAY ) ) , $ queryBuilder -> expr ( ) -> gte ( 'colPos' , $ queryBuilder -> createNamedParameter ( 0 , \ PDO :: PARAM_INT ) ) , $ queryBuilder -> expr ( ) -> in ( 'sys_language_uid' , $ queryBuilder -> createNamedParameter ( [ 0 , - 1 ] , Connection :: PARAM_INT_ARRAY ) ) ) -> orderBy ( 'inSet' ) -> addOrderBy ( 'colPos' ) -> addOrderBy ( 'sorting' ) -> execute ( ) -> fetchAll ( ) ; foreach ( $ items as $ item ) { if ( ! empty ( $ this -> extentensionConfiguration [ 'overlayShortcutTranslation' ] ) && $ language > 0 ) { $ translatedItem = BackendUtility :: getRecordLocalization ( 'tt_content' , $ item [ 'uid' ] , $ language ) ; if ( ! empty ( $ translatedItem ) ) { $ item = array_shift ( $ translatedItem ) ; } } if ( $ this -> helper -> getBackendUser ( ) -> workspace > 0 ) { BackendUtility :: workspaceOL ( 'tt_content' , $ item , $ this -> helper -> getBackendUser ( ) -> workspace ) ; } $ item [ 'tx_gridelements_reference_container' ] = $ item [ 'pid' ] ; $ collectedItems [ ] = $ item ; } }
Collects tt_content data from a single page or a page tree starting at a given page

@param string $shortcutItem : The single page to be used as the tree root
@param array $collectedItems : The collected item data rows ordered by parent position, column position and sorting
@param int $recursive : The number of levels for the recursion
@param int $parentUid : uid of the referencing tt_content record
@param int $language : sys_language_uid of the referencing tt_content record

@return void
Collects tt_content data from a single page or a page tree starting at a given page