1 | <?php |
||
11 | class Filter |
||
12 | { |
||
13 | /** @var string */ |
||
14 | protected $filterClass; |
||
15 | |||
16 | /** @var string */ |
||
17 | protected $property; |
||
18 | |||
19 | /** @var string */ |
||
20 | protected $columnName; |
||
21 | |||
22 | public function __construct(string $property, $filterClass, $columnName = null) |
||
30 | |||
31 | public function filter(Builder $builder, $value) |
||
37 | |||
38 | public static function exact(string $property, $columnName = null) : self |
||
42 | |||
43 | public static function partial(string $property, $columnName = null) : self |
||
47 | |||
48 | public static function scope(string $property, $columnName = null) : self |
||
52 | |||
53 | public static function custom(string $property, $filterClass, $columnName = null) : self |
||
57 | |||
58 | public function getProperty(): string |
||
62 | |||
63 | public function isForProperty(string $property): bool |
||
67 | |||
68 | public function getcolumnName(): string |
||
69 | { |
||
70 | return $this->columnName; |
||
71 | } |
||
72 | |||
73 | private function resolveFilterClass(): CustomFilter |
||
81 | } |
||
82 |