-
-
Notifications
You must be signed in to change notification settings - Fork 114
Expand file tree
/
Copy pathLimit.php
More file actions
43 lines (35 loc) · 831 Bytes
/
Limit.php
File metadata and controls
43 lines (35 loc) · 831 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
declare(strict_types=1);
namespace PhpMyAdmin\SqlParser\Components;
use PhpMyAdmin\SqlParser\Component;
/**
* `LIMIT` keyword parser.
*/
final class Limit implements Component
{
/**
* The number of rows skipped.
*/
public int|string $offset;
/**
* The number of rows to be returned.
*/
public int|string $rowCount;
/**
* @param int|string $rowCount the row count
* @param int|string $offset the offset
*/
public function __construct(int|string $rowCount = 0, int|string $offset = 0)
{
$this->rowCount = $rowCount;
$this->offset = $offset;
}
public function build(): string
{
return $this->offset . ', ' . $this->rowCount;
}
public function __toString(): string
{
return $this->build();
}
}