@param int $limit

@return array
164951
public function build(int $limit = 50000)
    {
        $sitemaps = [];

        $entities = $this->fetchEntities();

        if (count($entities) > $limit) {
            $sitemapIndex = new SiteMapIndexEntity();

            foreach (array_chunk($entities, $limit) as $i => $chunk) {
                $sitemap = $this->saveSitemap(sprintf('%s/sitemap-%s.xml', $this->path, $i), $chunk);
                $loc = sprintf('%s/sitemap-%s.xml', rtrim($this->hostWithScheme, '/'), $i);
                $sitemap->setLoc($loc);
                $sitemaps[] = sprintf('%s/sitemap-%s.xml', rtrim($this->path, '/'), $i);

                $sitemapIndex->addSiteMap($sitemap);
            }

            $this->saveFile(sprintf('%s/sitemap.xml', rtrim($this->path, '/')), $sitemapIndex->getXml());
        } else {
            $this->saveSitemap(sprintf('%s/sitemap.xml', rtrim($this->path, '/')), $entities);
        }

        $sitemaps[] = sprintf('%s/sitemap.xml', rtrim($this->path, '/'));

        return $sitemaps;
    }
869996
protected function getLastSearchesResultSet($limit) : array
    {
        $queryBuilder = $this->getQueryBuilder();
        return $queryBuilder
            ->select('keywords')
            ->addSelectLiteral(
                $queryBuilder->expr()->max('tstamp','maxtstamp')
            )
            ->from($this->table)
            // There is no support for DISTINCT, a ->groupBy() has to be used instead.
            ->groupBy('keywords')
            ->orderBy('maxtstamp', 'DESC')
            ->setMaxResults($limit)->execute()->fetchAll();
    }
962674
protected function getListLogOrder(array $limit)
    {
        $conditions = array(
            'limit' => $limit,
            'order_id' => $this->data_order['order_id']
        );

        return (array) $this->order_history->getList($conditions);
    }
1105277
public function read($limit = 0)
    {
        $this->limit($limit);
        $query = $this->buildSelect();
        $this->run($query['query'], $query['param']);

        return $this->next();
    }
216990
public function findLimited($limit = 0)
    {
        $queryBuilder = $this->createQueryBuilder('c')
            ->where('c.enabled = :enabled')
            ->orderBy('c.position')
            ->setParameters(array(
                'enabled' => true,
            ));

        if ($limit != 0) {
            $queryBuilder->setMaxResults($limit);
        }

        return $queryBuilder->getQuery()->getResult();
    }
794628
public static function getLimitString($limit)
    {
        if (isset($limit) && !empty($limit)) {
            $limitParts = GeneralUtility::trimExplode(',', $limit);
            if (count($limitParts) === 1) {
                return intval($limitParts[0]);
            }
            if (count($limitParts) === 2) {
                return intval($limitParts[0]) . ',' . intval($limitParts[1]);
            }
        }

        return '';
    }
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;
            }
        }
    }
1075189
public function fetchAll($limit = null, $offset = null){
		$limit = $limit === null ? -1 : (int) $limit;
		if($offset !== null)
			$this->seek((int) $offset);

		$row = $this->fetch();
		if(!$row)
			return array();

		$rows = array();
		do{
			if($limit === 0)
				break;
			$rows[] = $row;
			$limit--;
		} while($row = $this->fetch());

		return $rows;
	}
1016900
public function getTopThievesEntityData($limit = 10)
    {
        $topThieves = $this->gameDataService->getTopJobCharacter(2);

        return $topThieves->setMaxResults($limit)
            ->getQuery()
            ->getResult();
    }
524113
public function read(
        int $offset = ClientInterface::DEFAULT_OFFSET,
        int $limit = ClientInterface::DEFAULT_LIMIT
    ): array {
        return $this->doRead($this->file, $this->sheet, $this->range, $offset, $limit);
    }
423255
public function getByLimit(int $limit, array $where = [], array $with = [])
    {
        $query = $this->make($with);

        $query = $this->applyWhere($query, $where);

        return $query->take($limit)->get();
    }
1319842
public function loadAllLocations(int $offset = 0, int $limit = 25): array
    {
        return $this->service->loadAllLocations($offset, $limit);
    }
630554
public function getQueryResults($limit = null)
    {
        if (isset($limit)) {
            $this->queryBuilder->setMaxResults($limit);
        }
        
        if (!$this->queryBuilder->getDQLPart('orderBy')) {
            $this->queryBuilder->orderBy('a.createdAt', 'ASC');
        }

        return $this->queryBuilder->getQuery()->getResult();
    }
1174555
public function getNewBatch($limit = 0)
    {
        try {
            if (!is_numeric($limit) || $limit <= 0) {
                $limit = $this->limit;
            }
            return (new Query)
                    ->from($this->queueTable)
                    ->where(['status' => Email::STATUS_PENDING])
                    ->orderBy(['id' => SORT_ASC])
                    ->limit((int)$limit)
                    ->all($this->db);
        } catch (Exception $e) {
            Log::error($e->getMessage(), null, __METHOD__);
        }
    }
570282
public function getBaseColors($limit = 10) {

		if(false === ('-' . intval($limit) == '-' . $limit)) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type integer, "%s" given', __METHOD__, gettype($limit)), E_USER_ERROR);
		}

		return $this -> call() -> getBaseColors($limit);
	}
298200
public function getPosts( $limit = 100 ) {

        return $this->parseGetPosts(
            $this->service->api( $this->getWallGetRequestUrl( $limit ), 'GET' ),
            'response',
            [
                'id',
                'text'
            ],
            [
                'service_id_author' => 'from_id',
                'service_id_post'   => 'id',
                'time_created'      => 'date',
                'content'           => 'text'
            ] );
    }
1191551
protected function DESC($limit = NULL)
    {
        $value = array_reverse($this->value);
        if ($limit === NULL) {
            return $value;
        } else {
            return array_slice($value, 0, $limit);
        }
    }