mirror of
https://codeberg.org/vlw/php-mysql.git
synced 2025-09-14 00:33:41 +02:00
Merge branch 'master' into feat/limit-offset-arg2
This commit is contained in:
commit
b5eadae76b
1 changed files with 7 additions and 1 deletions
|
@ -150,7 +150,7 @@
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return SQL LIMIT string from integer or array of [offset => limit]
|
// SQL LIMIT string
|
||||||
public function limit(?int $limit, ?int $offset = null): self {
|
public function limit(?int $limit, ?int $offset = null): self {
|
||||||
// Unset row limit if null was passed
|
// Unset row limit if null was passed
|
||||||
if ($limit === null) {
|
if ($limit === null) {
|
||||||
|
@ -158,6 +158,12 @@
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Set LIMIT without range directly as integer
|
||||||
|
if (is_int($limit)) {
|
||||||
|
$this->limit = $limit;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
// No offset defined, set limit property directly as string
|
// No offset defined, set limit property directly as string
|
||||||
if (is_null($offset)) {
|
if (is_null($offset)) {
|
||||||
$this->limit = (string) $limit;
|
$this->limit = (string) $limit;
|
||||||
|
|
Loading…
Add table
Reference in a new issue