1 | <?php |
||
12 | class Filter |
||
13 | { |
||
14 | /** @var string */ |
||
15 | protected $filterClass; |
||
16 | |||
17 | /** @var string */ |
||
18 | protected $property; |
||
19 | |||
20 | /** @var string */ |
||
21 | protected $columnName; |
||
22 | |||
23 | /** @var Collection */ |
||
24 | protected $ignored; |
||
25 | |||
26 | public function __construct(string $property, $filterClass, $columnName = null) |
||
36 | |||
37 | public function filter(Builder $builder, $value) |
||
49 | |||
50 | public static function exact(string $property, $columnName = null) : self |
||
54 | |||
55 | public static function partial(string $property, $columnName = null) : self |
||
59 | |||
60 | public static function scope(string $property, $columnName = null) : self |
||
64 | |||
65 | public static function custom(string $property, $filterClass, $columnName = null) : self |
||
69 | |||
70 | public function getProperty(): string |
||
74 | |||
75 | public function isForProperty(string $property): bool |
||
79 | |||
80 | public function ignore(...$values): self |
||
88 | |||
89 | public function getIgnored(): array |
||
93 | |||
94 | public function getColumnName(): string |
||
98 | |||
99 | private function resolveFilterClass(): CustomFilter |
||
107 | |||
108 | private function resolveValueForFiltering($property) |
||
116 | } |
||
117 |