summaryrefslogtreecommitdiffstats
path: root/vendor/ipl/stdlib/src/Contract/Filterable.php
blob: 2a6316a3fa607904534004ec3cadcd1b0f92a645 (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
<?php

namespace ipl\Stdlib\Contract;

use ipl\Stdlib\Filter;

interface Filterable
{
    /**
     * Get the filter of the query
     *
     * @return Filter\Chain
     */
    public function getFilter();

    /**
     * Add a filter to the query
     *
     * Note that this method does not override an already set filter. Instead, multiple calls to this function add
     * the specified filter using a {@see Filter\All} chain.
     *
     * @param Filter\Rule $filter
     *
     * @return $this
     */
    public function filter(Filter\Rule $filter);

    /**
     * Add a filter to the query
     *
     * Note that this method does not override an already set filter. Instead, multiple calls to this function add
     * the specified filter using a {@see Filter\Any} chain.
     *
     * @param Filter\Rule $filter
     *
     * @return $this
     */
    public function orFilter(Filter\Rule $filter);

    /**
     * Add a filter to the query
     *
     * Note that this method does not override an already set filter. Instead, multiple calls to this function add
     * the specified filter wrapped by a {@see Filter\None} chain and using a {@see Filter\All} chain.
     *
     * @param Filter\Rule $filter
     *
     * @return $this
     */
    public function notFilter(Filter\Rule $filter);

    /**
     * Add a filter to the query
     *
     * Note that this method does not override an already set filter. Instead, multiple calls to this function add
     * the specified filter wrapped by a {@see Filter\None} chain and using a {@see Filter\Any} chain.
     *
     * @param Filter\Rule $filter
     *
     * @return $this
     */
    public function orNotFilter(Filter\Rule $filter);
}