/** * Fungsi untuk mengambil sejumlah destinasi special yang diambil secara acak untuk * ditampilkan di home * * @param integer $numb * @param integer $lang_id * @return array */ public function getRandomSpecialDestination($numberRandom, $langId = 1) { $data = $this->select()->from($this->_name, array('poi_id'))->join($this->_poidesc, "{$this->_name}.poi_id = {$this->_poidesc}.poi_id", array('name', 'description'))->setIntegrityCheck(false)->where("{$this->_name}.special = 1")->where("{$this->_name}.status != 0")->where("{$this->_poidesc}.language_id = ?", $langId)->order('RAND()')->limit($numberRandom, 0); $result = $this->fetchAll($data); $return = $result->toArray(); $imageDb = new Model_DbTable_Image(); for ($i = 0; $i < count($return); $i++) { $image = $imageDb->getMainImageSource($return[$i]['poi_id']); $return[$i]['source'] = $image['source']; } return $return; }