Set the limit of a rows or documents

@param  int $limit
@param  int $offset
@return PhalconCriteria
425998
public function limit($limit, $offset = null) {
		$this->_criteria->limit($limit, $offset);
		$this->_limit = (int) $limit;
				
		return $this;
	}
1321420
public function pagination(int $limit = 20, int $offset = 0, ?callable $totalQuery = null)
    {
        $query = clone $this->selectQueryInstance();

        return $query->paginate($limit, $offset, $totalQuery);
    }
746056
public function page($limit, $offset)
    {
        $this->limit = $limit;
        $this->offset = $offset;
        return $this;
    }
410392
public function withOffsetLimit($offset, $limit)
    {
        $new = clone $this;
        $new->offset = $offset;
        $new->limit = $limit;
        $new->paginationType = self::OFFSET_LIMIT_PAGINATION;

        return $new;
    }
39045
public function paginate(int $limit = 20, int $offset = 0, ?callable $totalQuery = null)
    {
        $this->rowsLimit = $limit;

        $this->rowsOffset = $offset;

        $records = $this->limit($limit)->offset($offset)->fetchAll();

        $this->setPristineRecords($records);

        if ($totalQuery) {
            $query = $this->newSelectQuery();

            call_user_func_array($totalQuery, [$query]);
        } else {
            $query = clone $this->getSelectQuery();

            $query->clearLimit();
            $query->clearOffset();
        }
        [$sql, $params] = $query->clearColumns()->count()->toSql();

        $this->rowsTotal = $this->connection()->sqlFetchColumn($sql, $params);

        return $this;
    }
1075637
public function limit($offset, $amount = null)
    {
        if (is_null($amount)) {
            $this->append(' LIMIT ' . $offset);
        } else {
            $this->append(sprintf(' LIMIT %s, %s', $offset, $amount));
        }

        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;
	}
1287118
public function limit($limit, $offset = null)
    {
        if ($offset) {
            $this->getLimit()->setParams(array($limit, $offset));
        } else {
            $this->getLimit()->setParams(array($limit));
        }

        return $this;
    }
267158
public function limit($offset = null, $limit = null)
    {
    	$args = func_get_args();
    	if (count($args) === 0) {
    		throw new Exception('At least 1 argument');
    	}
    	if (count($args) == 1) {
    		$this->limit =  $args[0];
    	} else {
    		list($this->offset, $this->limit) = $args;
    	}
        return $this;
    }
813337
protected function addLimit($limit, $offset = null) {
        $limitQuery = '';

        if (intval($limit) > 0) {
            $limitQuery .= $this->getDriverEscaper()->dbCommand('LIMIT') . ' ' . $limit;  
            if (!is_null($offset)) {
                $limitQuery .= ' ' . $this->getDriverEscaper()->dbCommand('OFFSET') . ' ' . $offset;
            }
        }
        

        return $limitQuery;
    }
289046
public function limit($offset, $rows = 0)
    {
        $offset = (int)($offset > 0 ? $offset : 0);
        $rows   = (int)($rows > 0 ? $rows : 0);
        
        $this->options['limit'] = "{$offset}, {$rows}";
        
        return $this;
    }
205616
public function limit($limit, $offset = 0)
    {
        $this->limit = $limit;
        $this->offset = $offset;

        return $this;
    }
133119
public function limit($limit) {
        if (!is_int($limit)) {
            $this->setError('q', 'No valid Limit');
            return false;
        }

        $this->q->apd(' LIMIT ' . $limit);
        return $this;
    }
1021695
public function setLimit($limit)
    {
        if (!is_scalar($limit)) {
            $this->limit = self::DEFAULT_LIMIT;

            return $this;
        } else {
            $limit = (int)$limit;
        }

        if ($limit > self::MAX_LIMIT) {
            $this->limit = self::MAX_LIMIT;
        } elseif ($limit < 1) {
            $this->limit = self::DEFAULT_LIMIT;
        } else {
            $this->limit = $limit;
        }

        return $this;
    }
1343217
public function limit(int $limit, int $offset = 0, bool $limitOnMainTable = false) : self
    {
        $this->qiterator = null;
        $this->li_of = [ $limit, $offset, $limitOnMainTable ? 1 : 0 ];
        return $this;
    }
486057
public function limit($limit)
    {
        if ($limit === null) {
            unset($this->parameters['Limit']);
        } else {
            $this->parameters['Limit'] = $limit;
        }

        return $this;
    }
316247
public function formatLimitOffset($limit, $offset = 0) {
        if ($limit && $offset) {
            return sprintf($this->getClause(self::LIMIT_OFFSET), (int) $limit, (int) $offset);
        }

        return $this->formatLimit($limit);
    }