1 | <?php |
||
16 | class Filter |
||
17 | { |
||
18 | /** |
||
19 | * @var null|AbstractCommon |
||
20 | */ |
||
21 | private static $analyzer = null; |
||
22 | |||
23 | /** |
||
24 | * @var array |
||
25 | */ |
||
26 | private static $filters = []; |
||
27 | |||
28 | /** |
||
29 | * Filter constructor. |
||
30 | * |
||
31 | * @param CaseInsensitive $caseInsensitive |
||
32 | */ |
||
33 | 29 | public function __construct(CaseInsensitive $caseInsensitive) |
|
37 | |||
38 | /** |
||
39 | * @param AbstractCommon $analyzer |
||
40 | */ |
||
41 | 1 | public static function setAnalyzer(AbstractCommon $analyzer) |
|
45 | |||
46 | /** |
||
47 | * @return null|AbstractCommon|CaseInsensitive |
||
48 | */ |
||
49 | 2 | public static function getAnalyzer() |
|
53 | |||
54 | /** |
||
55 | * @param string $filter |
||
56 | * @param mixed $option |
||
57 | */ |
||
58 | 22 | public static function addFilter($filter, $option) |
|
69 | |||
70 | /** |
||
71 | * @return void |
||
72 | */ |
||
73 | 7 | public function setFilters() |
|
74 | { |
||
75 | 7 | QueryParser::setDefaultEncoding('UTF-8'); |
|
76 | 7 | if (self::$analyzer instanceof AbstractCommon) { |
|
77 | 7 | Analyzer::setDefault(self::$analyzer); |
|
78 | 7 | } |
|
79 | |||
80 | 7 | } |
|
81 | |||
82 | /** |
||
83 | * @return array |
||
84 | */ |
||
85 | 1 | public static function getFilters() |
|
89 | } |
||
90 |