summaryrefslogtreecommitdiffstats
path: root/vendor/ipl/sql/src/LimitOffsetInterface.php
blob: 94628c41855284417a65710652e9d3b8b99bfe7c (plain)
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<?php

namespace ipl\Sql;

/**
 * Interface for pagination via {@link limit()} and {@link offset()}
 */
interface LimitOffsetInterface
{
    /**
     * Get whether a limit is configured
     *
     * @return bool
     */
    public function hasLimit();

    /**
     * Get the limit
     *
     * @return int|null
     */
    public function getLimit();

    /**
     * Set the limit
     *
     * @param int|null $limit Maximum number of items to return.
     *                        If you want to disable the limit, use null or a negative value
     *
     * @return $this
     */
    public function limit($limit);

    /**
     * Reset the limit
     *
     * @return $this
     */
    public function resetLimit();

    /**
     * Get whether an offset is configured
     *
     * @return bool
     */
    public function hasOffset();

    /**
     * Get the offset
     *
     * @return int|null
     */
    public function getOffset();

    /**
     * Set the offset
     *
     * @param int|null $offset Start result set after this many rows.
     *                         If you want to disable the offset, use null, 0, or a negative value
     *
     * @return $this
     */
    public function offset($offset);

    /**
     * Reset the offset
     *
     * @return $this
     */
    public function resetOffset();
}