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