Conditions | 4 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 3 | ||
Bugs | 1 | Features | 2 |
1 | <?php |
||
24 | public function setBody($params = null) |
||
25 | { |
||
26 | if (isset($this->_index)) { |
||
27 | $binds =[]; |
||
28 | $binds[] = "'" . Utils::escape($params['query']) . "'"; |
||
29 | $binds[] = "'" . $this->_index . "'"; |
||
30 | if (count($params['options']) > 0) { |
||
31 | foreach ($params['options'] as $name => $value) { |
||
32 | $binds[] = "$value AS $name"; |
||
33 | } |
||
34 | } |
||
35 | $this->_body = ['query' => "CALL SUGGEST(" . implode(",", $binds) . ")"]; |
||
36 | } else { |
||
37 | throw new RuntimeException('Index name is missing.'); |
||
38 | } |
||
57 |