lithium\data\model\Query::limit()
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. Ornull
to retrieve the current limit.
Returns
integer|null|QueryEither 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'];
}