public function getGroups(
        $user,
        /** @noinspection PhpUnusedParameterInspection */
        $knownGroups
    ) {
        $groupData = [];

            /** @var $requestHandler PageIndexerRequestHandler */
        $requestHandler = GeneralUtility::makeInstance(PageIndexerRequestHandler::class);
        $accessRootline = $requestHandler->getRequest()->getParameter('accessRootline');

        if ($user['username'] == self::SOLR_INDEXER_USERNAME && !empty($accessRootline)) {
            $accessRootline = GeneralUtility::makeInstance(Rootline::class, /** @scrutinizer ignore-type */ $accessRootline);
            $groups = $accessRootline->getGroups();

            foreach ($groups as $groupId) {
                // faking a user group record
                $groupData[] = [
                    'uid' => $groupId,
                    'pid' => 0,
                    'title' => '__SolrIndexerGroup__',
                    'TSconfig' => ''
                ];
            }
        }

        return $groupData;
    }
public function getGroups(
        $user,
        /** @noinspection PhpUnusedParameterInspection */
        $knownGroups
    ) {
        $groupData = [];

            /** @var $requestHandler PageIndexerRequestHandler */
        $requestHandler = GeneralUtility::makeInstance(PageIndexerRequestHandler::class);
        $accessRootline = $requestHandler->getRequest()->getParameter('accessRootline');

        if ($user['username'] == self::SOLR_INDEXER_USERNAME && !empty($accessRootline)) {
            $accessRootline = GeneralUtility::makeInstance(Rootline::class, /** @scrutinizer ignore-type */ $accessRootline);
            $groups = $accessRootline->getGroups();

            foreach ($groups as $groupId) {
                // faking a user group record
                $groupData[] = [
                    'uid' => $groupId,
                    'pid' => 0,
                    'title' => '__SolrIndexerGroup__',
                    'TSconfig' => ''
                ];
            }
        }

        return $groupData;
    }
public function getGroups ( $ user , /** @noinspection PhpUnusedParameterInspection */ $ knownGroups ) { $ groupData = [ ] ; /** @var $requestHandler PageIndexerRequestHandler */ $ requestHandler = GeneralUtility :: makeInstance ( PageIndexerRequestHandler :: class ) ; $ accessRootline = $ requestHandler -> getRequest ( ) -> getParameter ( 'accessRootline' ) ; if ( $ user [ 'username' ] == self :: SOLR_INDEXER_USERNAME && ! empty ( $ accessRootline ) ) { $ accessRootline = GeneralUtility :: makeInstance ( Rootline :: class , /** @scrutinizer ignore-type */ $ accessRootline ) ; $ groups = $ accessRootline -> getGroups ( ) ; foreach ( $ groups as $ groupId ) { // faking a user group record $ groupData [ ] = [ 'uid' => $ groupId , 'pid' => 0 , 'title' => '__SolrIndexerGroup__' , 'TSconfig' => '' ] ; } } return $ groupData ; }
Creates user group records so that the page indexer is granted access to
protected pages.

@param array $user Data of user.
@param array $knownGroups Group data array of already known groups. This is handy if you want select other related groups. Keys in this array are unique IDs of those groups.
@return mixed Groups array, keys = uid which must be unique
Creates user group records so that the page indexer is granted access to protected pages .