public function useSiteHashFromAllowedSites($allowedSites): QueryBuilder
    {
        $isAnySiteAllowed = trim($allowedSites) === '*';
        if ($isAnySiteAllowed) {
            // no filter required
            return $this;
        }

        $allowedSites = GeneralUtility::trimExplode(',', $allowedSites);
        $filters = [];
        foreach ($allowedSites as $site) {
            $siteHash = $this->siteHashService->getSiteHashForDomain($site);
            $filters[] = 'siteHash:"' . $siteHash . '"';
        }

        $siteHashFilterString = implode(' OR ', $filters);
        return $this->useFilter($siteHashFilterString, 'siteHash');
    }
public function useSiteHashFromAllowedSites($allowedSites): QueryBuilder
    {
        $isAnySiteAllowed = trim($allowedSites) === '*';
        if ($isAnySiteAllowed) {
            // no filter required
            return $this;
        }

        $allowedSites = GeneralUtility::trimExplode(',', $allowedSites);
        $filters = [];
        foreach ($allowedSites as $site) {
            $siteHash = $this->siteHashService->getSiteHashForDomain($site);
            $filters[] = 'siteHash:"' . $siteHash . '"';
        }

        $siteHashFilterString = implode(' OR ', $filters);
        return $this->useFilter($siteHashFilterString, 'siteHash');
    }
public function useSiteHashFromAllowedSites ( $ allowedSites ) : QueryBuilder { $ isAnySiteAllowed = trim ( $ allowedSites ) === '*' ; if ( $ isAnySiteAllowed ) { // no filter required return $ this ; } $ allowedSites = GeneralUtility :: trimExplode ( ',' , $ allowedSites ) ; $ filters = [ ] ; foreach ( $ allowedSites as $ site ) { $ siteHash = $ this -> siteHashService -> getSiteHashForDomain ( $ site ) ; $ filters [ ] = 'siteHash:"' . $ siteHash . '"' ; } $ siteHashFilterString = implode ( ' OR ' , $ filters ) ; return $ this -> useFilter ( $ siteHashFilterString , 'siteHash' ) ; }
Can be used to apply a list of allowed sites to the query.

@param string $allowedSites
@return QueryBuilder
Can be used to apply a list of allowed sites to the query .