@param int|null $limit

@return $this
486057
public function limit($limit)
    {
        if ($limit === null) {
            unset($this->parameters['Limit']);
        } else {
            $this->parameters['Limit'] = $limit;
        }

        return $this;
    }
1284811
public function prepareLimit($limit, $offset = null)
    {
        if ($offset) {
            $this->setLimit = ' LIMIT ' . $limit . ', ' . $offset . '';
        } else {
            $this->setLimit = ' LIMIT ' . $limit . '';
        }

        return $this;
    }
249499
public function limit($limit, $startFrom = false)
    {
        if ($startFrom !== false) {
            $this->setLimit(' LIMIT ' . $startFrom . ', ' . $limit);
        } else {
            $this->setLimit(' LIMIT ' . $limit);
        }

        return $this;
    }
1147586
public function limit($offset, $amount = null)
    {
        $this->queryBuilder->limit($offset, $amount);
        return $this;
    }
668281
public function limit(int $limit = 0): Update
    {
        if (!\is_int($limit) || $limit <= 0) {
            throw new InvalidArgumentException('$limit have to be a positive integer');
        }
        $this->limit = $limit;
        return $this;
    }
378458
public function limit($limit)
    {
        $limit = (int)$limit;
        $limit < 1 && $limit = 1;
        return $this->add('limit', $limit);
    }
213056
public function limit($limit) : QueryBuilder
    {
        $this->_query[] = "LIMIT";

        if(is_array($limit)) {
            $this->_query[] = $this->getQuoted($limit[0]).",";
            $this->_query[] = $this->getQuoted($limit[1]);

            return $this;
        }

        $this->_query[] = $this->getQuoted($limit);

        return $this;
    }
125635
private function getLimit(?int $limit = null): ?int
    {
        if (is_int($limit) && $limit >= 0) {
            return $limit;
        }

        return null;
    }
88542
final public function limit($limit, $offset = 0)
    {
        $this->_sql['limit'] = $limit;
        $this->offset($offset);
        return $this;
    }
1148232
public function limit(int $limit, int $offset = null): self
    {
        $this->query['limit'] = ($offset === null)
            ? [abs($limit)] : [abs($limit), abs($offset)];

        return $this;
    }
793499
public function limit($offset, $limit)
	{
		$sql = (string) $this->data_source;

		$result = $this->data_source->getConnection()
			->query('%sql OFFSET ? ROWS FETCH NEXT ? ROWS ONLY', $sql, $offset, $limit);

		$this->data = $result->fetchAll();

		return $this;
	}
976830
public function limit($limit, $offset = 0)
    {
        $this->builderCache->store('limit', $limit);
        $this->offset($offset);

        return $this;
    }
670310
public function isAfter($limit, $inclusive = false)
    {
        $this->addCondition(__METHOD__, [$limit, $inclusive]);

        return $this;
    }
165458
public function limit(int $limit) : Stage\Limit
    {
        $stage = new Stage\Limit($this, $limit);
        $this->addStage($stage);

        return $stage;
    }
885578
public function setLimit($limit)
    {
        $this->limit = $limit > 0 ? $limit : 1;

        $this->setPage($this->page);
    }
210972
public function limit($limit)
    {
        if (intval($limit) != $limit) {
            throw new \Exception('The limit must be an integer');
        }

        $this->limit = (int) $limit;

        return $this;
    }
992517
public function limit($limit, $offset = NULL) {
		if ($this->selection)
			$this->selection->limit($limit, $offset);
		else
			throw new RepositoryException("Before using the function limit(...) call read(...).");
		return $this;
	}