lithium\data\model\Query::limit()

public method

Set or get the limit for the amount of results to return.

Parameters

  • integer|boolean $limit

    An integer indicating the number of results to limit or false to employ no limit at all. Or null to retrieve the current limit.

Returns

integer|null|Query

Either the currrent limit when $limit is null or the query itself when setting the limit or providing false.

Source

	public function limit($limit = null) {
		if ($limit) {
			$this->_config['limit'] = (integer) $limit;
			return $this;
		}
		if ($limit === false) {
			$this->_config['limit'] = null;
			return $this;
		}
		return $this->_config['limit'];
	}