Conditions | 4 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 1 | Features | 2 |
1 | <?php |
||
13 | public function setBody($params = null) |
||
14 | { |
||
15 | if (isset($this->index)) { |
||
16 | $binds =[]; |
||
17 | $binds[] = "'" . static::escape($params['query']) . "'"; |
||
18 | $binds[] = "'" . $this->index . "'"; |
||
19 | if (count($params['options']) > 0) { |
||
20 | foreach ($params['options'] as $name => $value) { |
||
21 | $binds[] = "$value AS $name"; |
||
22 | } |
||
23 | } |
||
24 | return parent::setBody(['query' => "CALL SUGGEST(" . implode(",", $binds) . ")"]); |
||
25 | } |
||
26 | throw new RuntimeException('Index name is missing.'); |
||
27 | } |
||
44 |