Ejemplo n.º 1
0
 public function showlikedreslist($userid, $baseurl)
 {
     try {
         $likesmapper = new Restaurant_Model_RestaurantLikesMapper();
         $likeddata = $likesmapper->getLikedRestaurants($userid);
         $output = array();
         $resMapper = new Restaurant_Model_RestaurantMapper();
         $resCusineDataMapper = new Restaurant_Model_RestaurantCusineDataMapper();
         foreach ($likeddata as $value) {
             $arr = $resMapper->getListJson(NULL, NULL, $value['rlresid_fk_resid'], null);
             $mainData = $arr[0];
             $temp = array();
             $temp['data'] = array();
             $temp['data']['title'] = $mainData['resname'];
             $temp['data']['id'] = $mainData['resid'];
             $temp['data']['gallery'] = $this->getGalleryByRestaurantId($mainData['resid'], $baseurl);
             $temp['data']['item_specific'] = array();
             $temp['data']['location'] = $mainData['resaddress'];
             $temp['data']['item_specific']['diningStyle'] = $mainData['resdining_style'];
             $temp['data']['rating'] = $mainData['resrating'];
             $temp['data']['item_specific']['cusine'] = $resCusineDataMapper->getCusineNamesByResid($mainData['resid']);
             $temp['data']['dislikes'] = $mainData['res_dislikes'];
             $temp['data']['likes'] = $mainData['res_likes'];
             $temp['data']['city_name'] = $mainData['city_name'];
             $temp['data']['vanityUrl'] = $mainData['resvanity_url'];
             $output[] = $temp;
         }
         return $output;
     } catch (Exception $ex) {
         Rdine_Logger_FileLogger::info($ex->getMessage());
         throw new Exception($ex->getMessage());
     }
 }