protected function setLimitOrder($m, $q)
{
if ($m->limit && ($m->limit[0] || $m->limit[1])) {
if ($m->limit[0] === null) {
// This is max number which is allowed in MySQL server.
// But be aware, that PDO will downgrade this number even lower probably because
// in LIMIT it expects numeric value and converts string (we set float values as PDO_PARAM_STR)
// back to PDO_PARAM_INT which is goes back to max int value specific server can have.
// On my Win10,64-bit it is 2147483647, on Travis server 9223372036854775807 etc.
$m->limit[0] = '18446744073709551615';
}
$q->limit($m->limit[0], $m->limit[1]);
}
if ($m->order) {
foreach ($m->order as $o) {
$q->order($m->getElement($o[0]), $o[1]);
}
}
}