1 | <?php |
||
10 | class TNTSearchEngine extends Engine |
||
11 | { |
||
12 | /** |
||
13 | * Create a new engine instance. |
||
14 | * |
||
15 | * @param TeamTNT\TNTSearch\TNTSearch $tnt |
||
16 | * |
||
17 | * @return void |
||
|
|||
18 | */ |
||
19 | public function __construct(TNTSearch $tnt) |
||
23 | |||
24 | /** |
||
25 | * Update the given model in the index. |
||
26 | * |
||
27 | * @param Collection $models |
||
28 | * |
||
29 | * @return void |
||
30 | */ |
||
31 | public function update($models) |
||
47 | |||
48 | /** |
||
49 | * Remove the given model from the index. |
||
50 | * |
||
51 | * @param Collection $models |
||
52 | * |
||
53 | * @return void |
||
54 | */ |
||
55 | public function delete($models) |
||
65 | |||
66 | /** |
||
67 | * Perform the given search on the engine. |
||
68 | * |
||
69 | * @param Builder $builder |
||
70 | * |
||
71 | * @return mixed |
||
72 | */ |
||
73 | public function search(Builder $builder) |
||
77 | |||
78 | /** |
||
79 | * Perform the given search on the engine. |
||
80 | * |
||
81 | * @param Builder $builder |
||
82 | * @param int $perPage |
||
83 | * @param int $page |
||
84 | * |
||
85 | * @return mixed |
||
86 | */ |
||
87 | public function paginate(Builder $builder, $perPage, $page) |
||
91 | |||
92 | /** |
||
93 | * Perform the given search on the engine. |
||
94 | * |
||
95 | * @param Builder $builder |
||
96 | * @param array $options |
||
97 | * |
||
98 | * @return mixed |
||
99 | */ |
||
100 | protected function performSearch(Builder $builder, array $options = []) |
||
108 | |||
109 | /** |
||
110 | * Get the filter array for the query. |
||
111 | * |
||
112 | * @param Builder $builder |
||
113 | * |
||
114 | * @return array |
||
115 | */ |
||
116 | protected function filters(Builder $builder) |
||
122 | |||
123 | /** |
||
124 | * Map the given results to instances of the given model. |
||
125 | * |
||
126 | * @param mixed $results |
||
127 | * @param \Illuminate\Database\Eloquent\Model $model |
||
128 | * |
||
129 | * @return Collection |
||
130 | */ |
||
131 | public function map($results, $model) |
||
145 | |||
146 | public function initIndex($model) |
||
160 | } |
||
161 |
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.