1 | <?php |
||
14 | abstract class FiltersAbstract |
||
15 | { |
||
16 | protected $list = []; |
||
17 | |||
18 | protected function add(array $array) |
||
24 | |||
25 | protected function append($key, $value) |
||
31 | |||
32 | /** |
||
33 | * Acesso aos valores de um filtro. |
||
34 | * |
||
35 | * @param string $key |
||
36 | * |
||
37 | * @return array|null |
||
38 | */ |
||
39 | public function getValues($key) |
||
45 | |||
46 | /** |
||
47 | * Adiciona um valor a ValuesFilter existente. |
||
48 | * |
||
49 | * @param string $key |
||
50 | * @param type $value |
||
51 | * |
||
52 | * @return bool |
||
53 | */ |
||
54 | public function appendValueFilter($key, $value) |
||
67 | |||
68 | /** |
||
69 | * Filtra por Lista de valores de uma chave. |
||
70 | * |
||
71 | * @param string $key The key to filter on |
||
72 | * @param array $values The values to be filtered |
||
73 | */ |
||
74 | public function addValuesFilter($key, array $values) |
||
83 | |||
84 | /** |
||
85 | * Adiciona um filtro a partir de string no formato 0-10 (inicio - fim). |
||
86 | * |
||
87 | * @param string $key |
||
88 | * @param string $string |
||
89 | */ |
||
90 | public function addStringRangeFilter($key, $string) |
||
106 | |||
107 | public function addRangeFilter($key, $min, $max) |
||
117 | |||
118 | public function addGreaterThanFilter($key, $int) |
||
122 | |||
123 | /** |
||
124 | * Sintaxe de retorno: |
||
125 | * <code>. |
||
126 | * |
||
127 | * array( // Filters only support integer values |
||
128 | * array( |
||
129 | * 'key' => 'some_search_key', // The key to filter on |
||
130 | * 'values' => array(30,...), // The values to be filtered |
||
131 | * ), |
||
132 | * array( // This is a range filter |
||
133 | * 'key' => 'some_search_key', // The key to filter on |
||
134 | * 'min' => 5, // Min and Max value to filter between |
||
135 | * 'max' => 105, |
||
136 | * ), |
||
137 | * ... |
||
138 | * ); |
||
139 | * </code> |
||
140 | */ |
||
141 | public function toArray() |
||
145 | } |
||
146 |