1 | <?php |
||
12 | trait SearchTrait |
||
13 | { |
||
14 | /** |
||
15 | * @var array $searchFields |
||
16 | */ |
||
17 | private static $searchFields = []; |
||
18 | |||
19 | /** |
||
20 | * @var array $boostFields |
||
21 | */ |
||
22 | private static $boostFields = []; |
||
23 | |||
24 | /** |
||
25 | * @var bool |
||
26 | */ |
||
27 | private static $ignoreInsertOnce = false; |
||
28 | |||
29 | /** |
||
30 | * |
||
31 | */ |
||
32 | public static function ignoreInsertOnce() |
||
36 | /** |
||
37 | * Set up |
||
38 | * |
||
39 | * @throws \Exception |
||
40 | * @return void |
||
41 | */ |
||
42 | 18 | private static function setup() |
|
53 | |||
54 | /** |
||
55 | * Search Fields |
||
56 | * |
||
57 | * This should never get called. If it does get called, then it means that the Model which is using |
||
58 | * "SearchTrait" has not declared a "searchFields" method and made it static. |
||
59 | * |
||
60 | * @throws \Exception |
||
61 | */ |
||
62 | 1 | private static function searchFields() |
|
66 | |||
67 | /** |
||
68 | * @param array $fields |
||
69 | */ |
||
70 | 18 | public static function setSearchFields(array $fields) |
|
74 | |||
75 | /** |
||
76 | * @return array |
||
77 | */ |
||
78 | 2 | public static function getSearchFields() |
|
82 | |||
83 | /** |
||
84 | * @param array $fields |
||
85 | * @throws \Exception |
||
86 | */ |
||
87 | 2 | public static function setBoostFields(array $fields) |
|
96 | |||
97 | /** |
||
98 | * @return array |
||
99 | */ |
||
100 | 2 | public static function getBoostFields() |
|
104 | |||
105 | /** |
||
106 | * @return mixed |
||
107 | */ |
||
108 | 2 | public static function search() |
|
117 | |||
118 | /** |
||
119 | * @return void |
||
120 | */ |
||
121 | 18 | public static function bootSearchTrait() |
|
129 | |||
130 | /** |
||
131 | * @param Store $store |
||
132 | * @return \Closure |
||
133 | */ |
||
134 | 18 | private static function insertCallback(Store $store) |
|
145 | |||
146 | /** |
||
147 | * @param Store $store |
||
148 | * @return \Closure |
||
149 | */ |
||
150 | private static function deleteCallback(Store $store) |
||
157 | } |
||
158 |