Returns an array of log records for the order
@param array $limit
@return array
962674
protected function getListLogOrder(array $limit)
    {
        $conditions = array(
            'limit' => $limit,
            'order_id' => $this->data_order['order_id']
        );

        return (array) $this->order_history->getList($conditions);
    }
244797
public function getLog($limit = null, $skip = null)
    {
        $arguments  = array(
            '--xml',
            '--revision'    => 'HEAD:0'
        );


        $skip   = ($skip === null) ? 0 : (int)$skip;
        if ($limit !== null) {
            $arguments['--limit']    = (int)($limit + $skip);
        }

        /** @var $result CallResult */
        $result = $this->getSvn()->{'log'}($this->getRepositoryPath(), $arguments);
        $result->assertSuccess(sprintf('Cannot retrieve log from "%s"',
            $this->getRepositoryPath()
        ));

        $xml    = simplexml_load_string($result->getStdOut());
        if (!$xml) {
            throw new \RuntimeException(sprintf('Cannot read log XML for "%s"', $this->getRepositoryPath()));
        }
        $logEntries = new \ArrayIterator($xml->xpath('/log/logentry'));

        if ($limit !== null) {
            $logEntries = new \LimitIterator($logEntries, $skip, $limit);
        }

        $log = array();
        foreach ($logEntries as $item) {
            $log[]   = array(
                (string)$item['revision'],
                (string)$item->author,
                (string)$item->date,
                (string)$item->msg
            );
        }
        return $log;
    }
684689
public function getLog($sorted = false, $clear = true) {
		if ($sorted) {
			$log = sortByKey($this->_requestsLog, 'took', 'desc', SORT_NUMERIC);
		} else {
			$log = $this->_requestsLog;
		}
		if ($clear) {
			$this->_requestsLog = array();
		}
		return array('log' => $log, 'count' => count($log), 'time' => array_sum(Hash::extract($log, '{n}.took')));
	}
945726
public function getLogs($sort = 1)
    {
        $Logs = [];
        foreach ($this->travelLogs($sort) as $Log){
            $Logs[] = $Log;
        }
        return $Logs;
    }
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;
	}
822675
protected function getAll(array $columns = [], $limit = - 1)
    {
        $query = [
            'TableName' => $this->getTable(),
        ];
        $op    = 'Scan';
        if ($limit > - 1) {
            $query['limit'] = $limit;
        }
        if ( ! empty( $columns )) {
            $query['AttributesToGet'] = $columns;
        }
        // If the $where is not empty, we run getIterator.
        if ( ! empty( $this->where )) {
            // Primary key or index key condition exists, then use Query instead of Scan.
            // However, Query only supports a few conditions.
            if ($key = $this->conditionsContainIndexKey()) {
                $condition = array_get($this->where, "$key.ComparisonOperator");
                if (ComparisonOperator::isValidQueryDynamoDbOperator($condition)) {
                    $op                     = 'Query';
                    $query['IndexName']     = $this->dynamoDbIndexKeys[$key];
                    $query['KeyConditions'] = $this->where;
                }
            }
            $query['ScanFilter'] = $this->where;
        }

        // Sorting.
        $query['ScanIndexForward'] = $this->scanIndexForward;

        $iterator = $this->client->getIterator($op, $query);
        $results  = [];
        foreach ($iterator as $item) {
            $item  = $this->unmarshalItem($item);
            $model = new static($item, static::$dynamoDb);
            $model->setUnfillableAttributes($item);
            $model->exists = true;
            $model->syncOriginal();

            $results[] = $model;
        }

        return new Collection($results);
    }
330066
public function members(int $limit = 100) : array
    {
        $returnMembers = [];

        $members = $this->get(sprintf(self::COMMUNITY_ENDPOINT . 'communities/%s/members', $this->id()), [
            'limit' => $limit
        ]);

        if ($members->size === 0) return $returnMembers;

        foreach ($members->members as $member) {
            $returnMembers[] = new User($this->client, $member->onlineId);
        }

        return $returnMembers;
    }
1283490
public function getUserAgents($limit = 0)
    {
        $counter = 0;

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

            yield $line;
            ++$counter;
        }
    }
645184
protected function getMigrationHistory($limit)
    {
        if ($this->db->schema->getTableSchema($this->migrationTable, true) === null) {
            $this->createMigrationHistoryTable();
        }
        $query = new Query;
        $rows = $query->select(['version', 'apply_time'])
        ->from($this->migrationTable)
        ->orderBy('apply_time DESC, version DESC')
        ->limit($limit)
        ->createCommand($this->db)
        ->queryAll();
        $history = ArrayHelper::map($rows, 'version', 'apply_time');
        unset($history[self::BASE_MIGRATION]);

        return $history;
    }
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();
    }
282693
public function findLastPublications($limit = 5)
    {
        $qb = $this->createQueryBuilder('p');

        $currentTime = new \DateTime();

        $qb->select('p')
            ->where(
                $qb->expr()->lt('p.publicationAt', ':datetime')
            )
            ->andWhere('p.enabled = 1')
            ->orderBy('p.publicationAt', 'DESC')
            ->setMaxResults($limit);

        $qb->setParameter(':datetime', $currentTime);

        return $qb->getQuery()->getResult();
    }
1074947
protected function getReviewsProduct(array $limit)
    {
        $options = array(
            'status' => 1,
            'limit' => $limit,
            'user_status' => 1,
            'sort' => 'created',
            'order' => 'desc',
            'product_id' => $this->data_product['product_id']
        );

        $options += $this->query;
        $list = (array) $this->review->getList($options);
        $this->prepareReviewsProduct($list);
        return $list;
    }
1239051
public function getResult($limit = 0, $offset = 0)
    {
        $this->count();
        $this->queryBuilder->setFirstResult($offset)->setMaxResults($limit);

        if ($limit > 0) {
            $pathOrderBy = $this->getSqlPart($this->queryBuilder, 'orderBy');
            $this->resetSqlParts($this->queryBuilder, ['orderBy']);
            $qb = $this->cloneQb($this->queryBuilder);
            $qb->select(sprintf('%s', $this->aliasDotPrimary()))
                ->setFirstResult(null)
                ->setMaxResults(null);

            /** @var OrderBy $part */
            foreach ($pathOrderBy as $part) {
                foreach ($part->getParts() as $order) {
                    $out = [];
                    preg_match('/(.*[^\s])?\s+(asc|desc)/i', $order, $out);
                    $property = $out[1];
                    $direction = $out[2];
                    $alias = ($key = array_search($property, $this->aliasMapping)) ?: $property;
                    if ($this->isAggFunc($property)) {
                        $qb->addSelect($property.' AS '.$alias);
                        $qb->addOrderBy($alias, $direction);
                        $this->queryBuilder->addOrderBy($alias, $direction);
                    } else {
                        $qb->addOrderBy($property, $direction);
                        $this->queryBuilder->addOrderBy($property, $direction);
                    }
                }
            }

            $query = $qb->getQuery();

            foreach ($this->hints as $name => $hint) {
                $query->setHint($name, $hint);
            }

            $params = $types = [];
            /** @var Parameter $parameter */
            foreach ($query->getParameters() as $key => $parameter) {
                $params[$key] = $parameter->getValue();
                $types[$key] = $parameter->getType();
            }

            /** @var \PDOStatement $stmt */
            $stmt = $this->queryBuilder->getEntityManager()->getConnection()->executeQuery(
                $query->getSQL(),
                $params,
                $types
            );

            $ids = $stmt->fetchAll(\PDO::FETCH_COLUMN, 0);
            $ids = array_values(array_unique($ids));

            if (!$ids) {
                return [];
            }
            $ids = array_slice($ids, $offset, $limit);
            $this->queryBuilder
                ->setFirstResult(null)
                ->setMaxResults(null)
                ->where(sprintf("%s IN (:_sps_ids_)", $this->aliasDotPrimary()))
                ->setParameters(['_sps_ids_' => $ids]);
        }
        $query = $this->queryBuilder->getQuery();
        foreach ($this->hints as $name => $hint) {
            $query->setHint($name, $hint);
        }
        $this->result = $query->getResult();
        if (!$this->totalResultCount) {
            $this->totalResultCount = count($this->result);
        }

        return $this->result;
    }
1065833
protected function readTableData(string $tableName, int $limit = null): array
    {
        assert($limit === null || $limit > 0);

        $builder = $this->getConnection()->createQueryBuilder();
        $builder
            ->select('*')
            ->from($tableName);

        $limit === null ?: $builder->setMaxResults($limit);

        $result = $builder->execute()->fetchAll(PDO::FETCH_ASSOC);

        return $result;
    }
566200
public function getPending($limit = 10)
    {
        $results = $this->getCollection()
            ->find(array('processed' => false))
            ->limit($limit);

        return iterator_to_array($results);
    }
800147
public function getLog($limit = null, $skip = null)
    {
        $regularStyleArguments = array(
            'limit',
            'skip'
        );

        $namedStyleArguments = array(
            'abbrev' => null,
            'abbrev-commit' => null,
            'after' => null,
            'all' => null,
            'all-match' => null,
            'ancestry-path' => null,
            'author' => null,
            'basic-regexp' => null,
            'before' => null,
            'binary' => null,
            'bisect' => null,
            'boundary' => null,
            'branches' => null,
            'break-rewrites' => null,
            'cc' => null,
            'check' => null,
            'cherry' => null,
            'cherry-mark' => null,
            'cherry-pick' => null,
            'children' => null,
            'color' => null,
            'color-words' => null,
            'combined' => null,
            'committer' => null,
            'date' => null,
            'date-order' => null,
            'decorate' => null,
            'dense' => null,
            'diff-filter' => null,
            'dirstat' => null,
            'do-walk' => null,
            'dst-prefix' => null,
            'encoding' => null,
            'exit-code' => null,
            'ext-diff' => null,
            'extended-regexp' => null,
            'find-copies' => null,
            'find-copies-harder' => null,
            'find-renames' => null,
            'first-parent' => null,
            'fixed-strings' => null,
            'follow' => null,
            'format' => 'fuller',
            'full-diff' => null,
            'full-history' => null,
            'full-index' => null,
            'function-context' => null,
            'glob' => null,
            'graph' => null,
            'grep' => null,
            'grep-reflog' => null,
            'histogram' => null,
            'ignore-all-space' => null,
            'ignore-missing' => null,
            'ignore-space-at-eol' => null,
            'ignore-space-change' => null,
            'ignore-submodules' => null,
            'inter-hunk-context' => null,
            'irreversible-delete' => null,
            'left-only' => null,
            'left-right' => null,
            'log-size' => null,
            'max-count' => null,
            'max-parents' => null,
            'merge' => null,
            'merges' => null,
            'min-parents' => null,
            'minimal' => null,
            'name-only' => null,
            'name-status' => null,
            'no-abbrev' => null,
            'no-abbrev-commit' => null,
            'no-color' => null,
            'no-decorate' => null,
            'no-ext-diff' => null,
            'no-max-parents' => null,
            'no-merges' => null,
            'no-min-parents' => null,
            'no-notes' => null,
            'no-prefix' => null,
            'no-renames' => null,
            'no-textconv' => null,
            'no-walk' => null,
            'not' => null,
            'notes' => null,
            'numstat' => null,
            'objects' => null,
            'objects-edge' => null,
            'oneline' => null,
            'parents' => null,
            'patch' => null,
            'patch-with-raw' => null,
            'patch-with-stat' => null,
            'patience' => null,
            'perl-regexp' => null,
            'pickaxe-all' => null,
            'pickaxe-regex' => null,
            'pretty' => null,
            'raw' => null,
            'regexp-ignore-case' => null,
            'relative' => null,
            'relative-date' => null,
            'remotes' => null,
            'remove-empty' => null,
            'reverse' => null,
            'right-only' => null,
            'shortstat' => null,
            'show-notes' => null,
            'show-signature' => null,
            'simplify-by-decoration' => null,
            'simplify-merges' => null,
            'since' => null,
            'skip' => null,
            'source' => null,
            'sparse' => null,
            'src-prefix' => null,
            'stat' => null,
            'stat-count' => null,
            'stat-graph-width' => null,
            'stat-name-width' => null,
            'stat-width' => null,
            'stdin' => null,
            'submodule' => null,
            'summary' => true,
            'tags' => null,
            'text' => null,
            'textconv' => null,
            'topo-order' => null,
            'unified' => null,
            'unpacked' => null,
            'until' => null,
            'verify' => null,
            'walk-reflogs' => null,
            'word-diff' => null,
            'word-diff-regex' => null,
            'z' => true
        );

        $arguments = func_get_args();

        $arguments = $this->_parseNamedArguments($regularStyleArguments, $namedStyleArguments, $arguments);

        if (!empty($arguments['limit'])) {
            $limit = '' . (int) $arguments['limit'];

            unset($arguments['limit']);
            array_unshift($arguments, $limit);
        }

        $arguments = $this->_prepareNamedArgumentsForCLI($arguments);

        /** @var $result CallResult */
        $result = $this->getGit()->{'log'}($this->getRepositoryPath(), $arguments);
        $result->assertSuccess(sprintf('Cannot retrieve log from "%s"',
            $this->getRepositoryPath()
        ));

        $output     = $result->getStdOut();
        $log        = array_map(function($f) {
            return trim($f);
        }, explode("\x0", $output));

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

        return $topThieves->setMaxResults($limit)
            ->getQuery()
            ->getResult();
    }