1 | <?php |
||
8 | abstract class Filter implements FilterInterface |
||
9 | { |
||
10 | protected $type; |
||
11 | |||
12 | protected $value; |
||
13 | |||
14 | protected $name; |
||
15 | |||
16 | protected $title; |
||
17 | |||
18 | protected $defaultValue; |
||
19 | |||
20 | protected $operator = '='; |
||
21 | |||
22 | public function __construct($name, $title) |
||
27 | |||
28 | protected function setValueFromRequest() |
||
34 | |||
35 | protected function getRequestInputValue() |
||
41 | |||
42 | /** |
||
43 | * Dots and spaces in variable names are converted to underscores. |
||
44 | * For example <input name="a.b" /> becomes $_REQUEST["a_b"]. |
||
45 | * |
||
46 | * @see http://php.net/manual/en/language.variables.external.php |
||
47 | * |
||
48 | * @return mixed |
||
49 | */ |
||
50 | protected function getRequestName() |
||
54 | |||
55 | /** |
||
56 | * {@inheritdoc} |
||
57 | */ |
||
58 | public function apply(Builder $query) |
||
70 | |||
71 | /** |
||
72 | * Build the filter query. |
||
73 | * |
||
74 | * @param \Illuminate\Database\Eloquent\Builder $query |
||
75 | * @param string $name |
||
76 | */ |
||
77 | protected function buildQuery(Builder $query, $name) |
||
97 | |||
98 | /** |
||
99 | * {@inheritdoc} |
||
100 | */ |
||
101 | public function getValue() |
||
105 | |||
106 | /** |
||
107 | * {@inheritdoc} |
||
108 | */ |
||
109 | public function getDisplayValue() |
||
118 | |||
119 | /** |
||
120 | * {@inheritdoc} |
||
121 | */ |
||
122 | public function setValue($value) |
||
128 | |||
129 | /** |
||
130 | * {@inheritdoc} |
||
131 | */ |
||
132 | public function getName() |
||
136 | |||
137 | /** |
||
138 | * {@inheritdoc} |
||
139 | */ |
||
140 | public function setName($name) |
||
146 | |||
147 | /** |
||
148 | * {@inheritdoc} |
||
149 | */ |
||
150 | public function getTitle() |
||
154 | |||
155 | /** |
||
156 | * {@inheritdoc} |
||
157 | */ |
||
158 | public function setTitle($title) |
||
164 | |||
165 | /** |
||
166 | * {@inheritdoc} |
||
167 | */ |
||
168 | public function getDefaultValue() |
||
172 | |||
173 | /** |
||
174 | * {@inheritdoc} |
||
175 | */ |
||
176 | public function setDefaultValue($defaultValue) |
||
182 | |||
183 | /** |
||
184 | * {@inheritdoc} |
||
185 | */ |
||
186 | public function getOperator() |
||
190 | |||
191 | /** |
||
192 | * {@inheritdoc} |
||
193 | */ |
||
194 | public function setOperator(string $operator) |
||
200 | |||
201 | public function isActive() |
||
205 | |||
206 | public function toArray() |
||
214 | |||
215 | public function jsonSerialize() |
||
219 | |||
220 | public function toJson($options = 0) |
||
224 | |||
225 | public function __toString() |
||
229 | } |
||
230 |