1 | <?php |
||
18 | class Search |
||
19 | { |
||
20 | /** @var string|\Spatie\QueryBuilder\Searches\Search */ |
||
21 | protected $searchClass; |
||
22 | |||
23 | /** @var string */ |
||
24 | protected $property; |
||
25 | |||
26 | /** @var string */ |
||
27 | protected $columnName; |
||
28 | |||
29 | /** @var Collection */ |
||
30 | protected $ignored; |
||
31 | |||
32 | public function __construct(string $property, $searchClass, ?string $columnName = null) |
||
42 | |||
43 | public function search(Builder $builder, $value, $modifier = null) |
||
55 | |||
56 | public static function begins(string $property, ?string $columnName = null): self |
||
60 | |||
61 | public static function ends(string $property, ?string $columnName = null): self |
||
65 | |||
66 | public static function exact(string $property, ?string $columnName = null): self |
||
70 | |||
71 | public static function partial(string $property, $columnName = null): self |
||
75 | |||
76 | public static function split(string $property, $columnName = null): self |
||
80 | |||
81 | public static function splitBegins(string $property, ?string $columnName = null): self |
||
85 | |||
86 | public static function splitEnds(string $property, ?string $columnName = null): self |
||
90 | |||
91 | public static function resolver(string $property, $columnName = null): self |
||
95 | |||
96 | public static function custom(string $property, $searchClass, $columnName = null): self |
||
100 | |||
101 | public function getProperty(): string |
||
105 | |||
106 | public function isForProperty(string $property): bool |
||
110 | |||
111 | public function ignore(...$values): self |
||
119 | |||
120 | public function getIgnored(): array |
||
124 | |||
125 | public function getColumnName(): string |
||
129 | |||
130 | private function resolveSearchClass(): CustomSearch |
||
138 | |||
139 | private function resolveValueForSearching($property) |
||
149 | } |
||
150 |