1 | <?php |
||
10 | class Limit |
||
11 | { |
||
12 | /** |
||
13 | * @var int |
||
14 | */ |
||
15 | protected $limit; |
||
16 | |||
17 | /** |
||
18 | * @var int |
||
19 | */ |
||
20 | protected $originalLimit; |
||
21 | |||
22 | /** |
||
23 | * @var bool |
||
24 | */ |
||
25 | protected $isSupportQuery; |
||
26 | |||
27 | /** |
||
28 | * Limit constructor. |
||
29 | * |
||
30 | * @param int $originalLimit |
||
31 | * @param bool $isSupportQuery |
||
32 | */ |
||
33 | 17 | public function __construct($originalLimit, $isSupportQuery = false) |
|
39 | |||
40 | /** |
||
41 | * @param int $limit |
||
42 | * @param bool $isSupportQuery |
||
43 | * @return int |
||
44 | */ |
||
45 | 17 | protected static function validate($limit, $isSupportQuery) |
|
55 | |||
56 | /** |
||
57 | * @return int |
||
58 | */ |
||
59 | 17 | public function toInteger() |
|
63 | |||
64 | /** |
||
65 | * @return int |
||
66 | */ |
||
67 | 17 | public function original() |
|
71 | |||
72 | /** |
||
73 | * @return bool |
||
74 | */ |
||
75 | public function isMainQuery() |
||
79 | |||
80 | /** |
||
81 | * @return bool |
||
82 | */ |
||
83 | public function isSupportQuery() |
||
87 | |||
88 | /** |
||
89 | * @return static |
||
90 | */ |
||
91 | 10 | public function inverse() |
|
95 | } |
||
96 |