Aggregate.php
4 years ago
CRUD.php
4 years ago
FromClause.php
4 years ago
GroupByStatement.php
4 years ago
HavingClause.php
4 years ago
JoinClause.php
4 years ago
LimitStatement.php
4 years ago
MetaQuery.php
4 years ago
OffsetStatement.php
4 years ago
OrderByStatement.php
4 years ago
SelectStatement.php
4 years ago
TablePrefix.php
4 years ago
UnionOperator.php
4 years ago
WhereClause.php
3 years ago
OffsetStatement.php
34 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Give\Framework\QueryBuilder\Concerns; |
| 4 | |
| 5 | /** |
| 6 | * @since 2.19.0 |
| 7 | */ |
| 8 | trait OffsetStatement |
| 9 | { |
| 10 | /** |
| 11 | * @var int |
| 12 | */ |
| 13 | protected $offset; |
| 14 | |
| 15 | /** |
| 16 | * @param int $offset |
| 17 | * |
| 18 | * @return $this |
| 19 | */ |
| 20 | public function offset($offset) |
| 21 | { |
| 22 | $this->offset = (int)$offset; |
| 23 | |
| 24 | return $this; |
| 25 | } |
| 26 | |
| 27 | protected function getOffsetSQL() |
| 28 | { |
| 29 | return $this->limit && $this->offset |
| 30 | ? ["OFFSET {$this->offset}"] |
| 31 | : []; |
| 32 | } |
| 33 | } |
| 34 |