summaryrefslogtreecommitdiffstats
path: root/vendor/ipl/stdlib/src/Contract/Paginatable.php
blob: 3e2a4eeefcac70e9860a4a4e4b3f72d3067b2ea3 (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
<?php

namespace ipl\Stdlib\Contract;

use Countable;

interface Paginatable extends Countable
{
    /**
     * Get whether a limit is set
     *
     * @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,
     *                        it is best practice to use null or a negative value
     *
     * @return $this
     */
    public function limit($limit);

    /**
     * Get whether an offset is set
     *
     * @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,
     *                         it is best practice to use null or a negative value
     *
     * @return $this
     */
    public function offset($offset);
}