CMTV
Well-known member
Hi!
As you can see, the following line
sets the minimum value of limit to 1.
Why so? Sometimes it is very convenient to limit the results by some variable which value can be 0 and return an empty

AbstractAdapter class, line 560:
PHP:
public function limit($query, $amount, $offset = 0)
{
$offset = max(0, intval($offset));
if ($amount === null)
{
if (!$offset)
{
// no limit
return $query;
}
// no amount limit, but there's an offset
$amount = 1000000;
}
$amount = max(1, intval($amount));
return "$query\nLIMIT $amount" . ($offset ? " OFFSET $offset" : '');
}
As you can see, the following line
PHP:
$amount = max(1, intval($amount));
Why so? Sometimes it is very convenient to limit the results by some variable which value can be 0 and return an empty
AbstractCollection then (when using finder)...