| Conditions | 3 |
| Paths | 2 |
| Total Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 23 | public function suggestByFields($searchTerm, $fields, $limit = 10) |
||
| 24 | { |
||
| 25 | $query = $this->getQuery(); |
||
| 26 | $query->setTerm($searchTerm); |
||
| 27 | $query->setCount($limit); |
||
| 28 | |||
| 29 | if (is_array($fields)) { |
||
|
|
|||
| 30 | foreach ($fields as $field) { |
||
| 31 | $query->addField($field); |
||
| 32 | } |
||
| 33 | } |
||
| 34 | |||
| 35 | return $query->suggest(); |
||
| 36 | } |
||
| 37 | } |