Conditions | 2 |
Paths | 2 |
Total Lines | 17 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
1 | <?php |
||
27 | public function getResultsFor($word, $language, $limit = 10) { |
||
28 | /* @var $db \CI_DB_active_record */ |
||
29 | $db = \CI::$APP->db; |
||
30 | $results = $db->select("$this->nameColumn, $this->urlColumn") |
||
31 | ->from($this->table) |
||
32 | ->join($this->translations, "{$this->table}.id = {$this->translations}.id") |
||
33 | ->like($this->nameColumn, $word) |
||
34 | ->where($this->langColumn, $language) |
||
35 | ->limit($limit) |
||
36 | ->get() |
||
37 | ->result_array(); |
||
38 | $result = new Result($this->getGroupName()); |
||
39 | foreach ($results as $oneResult) { |
||
40 | $result->addResult($oneResult['name'], $this->formUrl($oneResult['url'])); |
||
41 | } |
||
42 | return $result; |
||
43 | } |
||
44 | |||
74 | } |