public function getTourismoperatorById($poiId, $classification_id, $languageId, $sortingOptions = null) { $areaDb = new Model_DbTable_Area(); $areaList = $areaDb->getCitiesByPoiId($poiId, $languageId); $query = $this->select()->from($this->_name)->join($this->_to, "{$this->_to}.tourismoperator_id = {$this->_name}.tourismoperator_id")->join($this->_ctt, "{$this->_ctt}.tourismoperator_id = {$this->_name}.tourismoperator_id", array('classification_id'))->join($this->_td, "{$this->_td}.tourismoperator_id = {$this->_name}.tourismoperator_id", array('name AS nama', 'description'))->setIntegrityCheck(false)->where("{$this->_td}.language_id = ?", $languageId)->where("{$this->_ctt}.classification_id = ?", $classification_id)->where("{$this->_name}.area_id IN (?)", $areaList); $sortBy = $this->_getSortBy($sortingOptions['sort_by'], $sortingOptions['sort_order']); $query->order($sortBy); //echo $query->__toString(); return $query; }
public function getAllClassIDByPoiId($poiId, $languageId) { $areaDb = new Model_DbTable_Area(); $areaList = $areaDb->getCitiesByPoiId($poiId, $languageId); if (count($areaList) > 0) { $query = $this->select()->from($this->_name, array('classification_id'))->join($this->_tourism, "{$this->_tourism}.tourismoperator_id = {$this->_name}.tourismoperator_id", array())->setIntegrityCheck(false)->where("{$this->_tourism}.area_id IN (?)", $areaList); return $this->fetchAll($query)->toArray(); } return array(); //echo $query->__toString(); }