Returns the list of websites from the ID array in parameters.
The user access is not checked in this method so the ID have to be accessible by the user!

@param array $idSites list of website ID
@param bool $limit
@return array
187436
private function getSitesFromIds($idSites, $limit = false)
    {
        $sites = $this->getModel()->getSitesFromIds($idSites, $limit);

        foreach ($sites as &$site) {
            $this->enrichSite($site);
        }

        $sites = Site::setSitesFromArray($sites);

        return $sites;
    }
1152679
public function findByIds($ids)
    {
        if (!is_array($ids)) {
            $ids = explode(',', $ids);
        }

        if (!$ids) {
            return [];
        }

        return $this->createValuedQueryBuilder('c')
            ->andWhere('c.id IN (:ids)')->setParameter('ids', $ids)
            ->andWhere('c.deletedAt IS NULL')
            ->andWhere('c.active = :active')
            ->andWhere('c.layout = :layout')
            ->andWhere('c.publishAt < :now OR c.publishAt IS NULL')->setParameter('now', new \DateTime())
            ->setParameter('active', true)
            ->setParameter('layout', false)
            ->getQuery()
            ->useResultCache(true, self::CACHE_TTL)
            ->getResult();
    }
1007199
public function findAllCurrentIds($limit = 1000)
    {
        try {
            $queryBuilder = $this->getValidSpecialPriceQuery()
                ->select('specialPrice.id')
                ->addOrderBy('specialPrice.id', 'DESC');
            $query = $queryBuilder->getQuery()
                ->useResultCache(true, 3600);

            $ids = $query->getScalarResult();

            return array_column($ids, 'id');
        } catch (NoResultException $exc) {
            return null;
        }
    }
663912
private function fetchRangeIds($limit, $start)
    {
        $qb = $this->createFilterAndSortQueryBuilder();
        $qb->select(['t.id', 'e.latest_version']);

        if (null !== $limit) {
            $qb->setFirstResult($start);
            $qb->setMaxResults($limit);
        }

        $rows = $this->connection->fetchAll($qb->getSQL());

        $ids = [];
        foreach ($rows as $row) {
            $ids[$row['id']] = $row['latest_version'];
        }

        return $ids;
    }
814875
public function getExitPageUrls($idSite, $period, $date, $segment = false, $expanded = false, $idSubtable = false, $flat = false)
    {
        Piwik::checkUserHasViewAccess($idSite);

        $dataTable = $this->getPageUrls($idSite, $period, $date, $segment, $expanded, $idSubtable, false, $flat);
        $this->filterNonExitActions($dataTable);
        return $dataTable;
    }
110719
public function findItemsToIndex(Site $site, int $limit = 50) : array
    {
        $queryBuilder = $this->getQueryBuilder();
        // determine which items to index with this run
        $indexQueueItemRecords = $queryBuilder
            ->select('*')
            ->from($this->table)
            ->andWhere(
                $queryBuilder->expr()->eq('root', $site->getRootPageId()),
                $queryBuilder->expr()->gt('changed', 'indexed'),
                $queryBuilder->expr()->lte('changed', time()),
                $queryBuilder->expr()->eq('errors', $queryBuilder->createNamedParameter(''))
            )
            ->orderBy('indexing_priority', 'DESC')
            ->addOrderBy('changed', 'DESC')
            ->addOrderBy('uid', 'DESC')
            ->setMaxResults($limit)
            ->execute()->fetchAll();

        return $this->getIndexQueueItemObjectsFromRecords($indexQueueItemRecords);
    }
413045
public function getUserAgents($limit = 0)
    {
        $counter = 0;

        foreach ($this->loadFromPath() as $row) {
            if ($limit && $counter >= $limit) {
                return;
            }

            $row = json_decode($row, false);
            yield trim($row->user_agent);
            ++$counter;
        }
    }
970958
public static function getRootPageIdsFromSites(array $sites): array
    {
        $rootPageIds = [];
        foreach ($sites as $site) {
            $rootPageIds[] = (int)$site->getRootPageId();
        }

        return $rootPageIds;
    }
55415
public function get(array $ids = [], array $codes = [], $name = null, array $spaceIds = [], $limit = self::MAX_GET_APPS, $offset = 0, $guestSpaceId = null): array
    {
        $options = ['json' => compact('ids', 'codes', 'name', 'spaceIds')];
        $options['json']['limit'] = $limit;
        $options['json']['offset'] = $offset;

        /** @var JsonStream $stream */
        $stream = $this->client
            ->get(KintoneApi::generateUrl('apps.json', $guestSpaceId), $options)
            ->getBody();

        return $stream->jsonSerialize();
    }
517072
protected function getSite($sites, $site_id)
    {
        $site_found = collect($sites)->filter(function ($site) use ($site_id) {
            return $site->id === $site_id;
        })->first();

        if ($site_found) {
            return $site_found;
        }
        return null;
    }
1173807
public function getByIds($ids, $locale)
    {
        if (!is_array($ids) || 0 === count($ids)) {
            return [];
        }

        $accounts = $this->accountRepository->findByIds($ids);

        return array_map(
            function($account) use ($locale) {
                return $this->getApiObject($account, $locale);
            },
            $accounts
        );
    }
1198142
protected function getItems( array $ids, $prefix )
	{
		$search = $this->getManager()->createSearch();
		$search->setConditions( $search->compare( '==', $prefix . '.id', $ids ) );
		$search->setSlice( 0, count( $ids ) );
		$items = $this->toArray( $this->getManager()->searchItems( $search ) );

		return array(
			'items' => ( count( $ids ) === 1 ? reset( $items ) : $items ),
			'success' => true,
		);
	}
396440
public function getUserAgents($limit = 0)
    {
        $counter   = 0;
        $allAgents = [];

        foreach ($this->collection as $source) {
            if ($limit && $counter >= $limit) {
                return;
            }

            foreach ($source->getUserAgents($limit) as $ua) {
                if ($limit && $counter >= $limit) {
                    return;
                }

                if (empty($ua)) {
                    continue;
                }

                if (array_key_exists($ua, $allAgents)) {
                    continue;
                }

                yield $ua;
                $allAgents[$ua] = 1;
                ++$counter;
            }
        }
    }
301792
public function getSiteUrlsFromId($idSite)
    {
        $urls = $this->getAliasSiteUrlsFromId($idSite);
        $site = $this->getSiteFromId($idSite);

        if (empty($site)) {
            return $urls;
        }

        return array_merge(array($site['main_url']), $urls);
    }
411733
public function several(array $ids)
    {
        $results = [];

        foreach ($ids as $cacheId) {
            if ($this->cache->test($cacheId)) {
                $results[$cacheId] = $this->cache->load($cacheId);
            }

        }

        return $results;
    }
996068
public function initWebsiteIds()
    {
        if (count($this->shouldArchiveSpecifiedSites) > 0) {
            $this->logger->info("- Will process " . count($this->shouldArchiveSpecifiedSites) . " websites (--force-idsites)");

            return $this->shouldArchiveSpecifiedSites;
        }

        $this->findWebsiteIdsInTimezoneWithNewDay($this->allWebsites);
        $this->findInvalidatedSitesToReprocess();

        if ($this->shouldArchiveAllSites) {
            $this->logger->info("- Will process all " . count($this->allWebsites) . " websites");
        }

        return $this->allWebsites;
    }
1032450
public function getModifiedWishlistToImport(\Magento\Store\Api\Data\WebsiteInterface $website, $limit = 100)
    {
        return $this->wishlistCollection->create()
                                        ->getModifiedWishlistToImportByWebsite($website, $limit);
    }