summaryrefslogtreecommitdiffstats
path: root/library/Icinga/Data/Limitable.php
blob: 8591a79ff121fc0b8d22bc7716a4a5b2ca1b6cd3 (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
<?php
/* Icinga Web 2 | (c) 2014 Icinga Development Team | GPLv2+ */

namespace Icinga\Data;

/**
 * Interface for retrieving just a portion of a result set
 */
interface Limitable
{
    /**
     * Set a limit count and offset
     *
     * @param   int $count  Number of rows to return
     * @param   int $offset Start returning after this many rows
     *
     * @return  self
     */
    public function limit($count = null, $offset = null);

    /**
     * Whether a limit is set
     *
     * @return bool
     */
    public function hasLimit();

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

    /**
     * Whether an offset is set
     *
     * @return bool
     */
    public function hasOffset();

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