mirror of
https://github.com/dg/dibi.git
synced 2025-10-23 18:56:06 +02:00
applyLimit support
This commit is contained in:
@@ -157,6 +157,19 @@ class DibiMySqliDriver extends DibiDriver {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @see DibiDriver::applyLimit()
|
||||
*/
|
||||
public function applyLimit(&$sql, $limit, $offset = 0)
|
||||
{
|
||||
if ($limit < 0 && $offset < 1) return;
|
||||
|
||||
// see http://dev.mysql.com/doc/refman/5.0/en/select.html
|
||||
$sql .= ' LIMIT ' . ($limit < 0 ? '18446744073709551615' : (int) $limit)
|
||||
. ($offset > 0 ? ' OFFSET ' . (int) $offset : '');
|
||||
}
|
||||
|
||||
|
||||
} // class DibiMySqliDriver
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user