public function getAllByCategoryList($categoryId, $languageId) { $categoryDb = new Model_DbTable_Category(); // Cek apakah si kategori punya sub kategori, jika tidak maka set // isinya ke kategori dia sendiri $childList = $categoryDb->getCategoryChildListForForm($categoryId, $languageId); if (empty($childList)) { $childList = $categoryId; } $query = $this->select()->setIntegrityCheck(false)->from($this->_name, array('poi_id', 'poi_name' => 'name', 'description'))->join($this->_desti, "{$this->_desti}.poi_id = {$this->_name}.poi_id", array('pointX', 'pointY', 'special'))->join($this->_cattopoi, "{$this->_cattopoi}.poi_id = {$this->_name}.poi_id", array(''))->where("{$this->_name}.language_id = ?", $languageId)->where("{$this->_cattopoi}.category_id = ? ", $categoryId)->group("{$this->_name}.poi_id"); //echo $query->__toString(); $data = $this->fetchAll($query); if (count($data)) { return $data->toArray(); } else { return array(); } }