public function saveRestaurantData(Restaurant_Model_Restaurant $restaurantModel, $location_name) { try { $db = $this->getDbTable(); $resdata = array(); $resdata['resid'] = $restaurantModel->getResid(); $resdata['resname'] = $restaurantModel->getResname(); $resdata['rescapacity'] = $restaurantModel->getRescapacity(); $resdata['resemail'] = $restaurantModel->getResemail(); $resdata['resyear_founded'] = $restaurantModel->getResyear_founded(); $resdata['resprice'] = $restaurantModel->getResprice(); $resdata['resaddress'] = $restaurantModel->getResaddress(); $resdata['rescity_id'] = $restaurantModel->getRescity_id(); $resdata['reslocation_id'] = $restaurantModel->getReslocation_id(); $resdata['reszipcode'] = $restaurantModel->getReszipcode(); $resdata['resphone'] = $restaurantModel->getResphone(); $resdata['resfax'] = $restaurantModel->getResfax(); $resdata['restimezone'] = $restaurantModel->getRestimezone(); $resdata['reswebsite'] = $restaurantModel->getReswebsite(); $resdata['resdescription'] = $restaurantModel->getResdescription(); $resdata['resdining_style'] = $restaurantModel->getResdining_style(); $resdata['resparking'] = $restaurantModel->getResparking(); $resdata['resprivate_party'] = $restaurantModel->getResprivate_party(); $resdata['resprivate_party_contact'] = $restaurantModel->getResprivate_party_contact(); $resdata['resentertainment'] = $restaurantModel->getResentertainment(); $resdata['resreservation_system'] = $restaurantModel->getResreservation_system(); $resdata['resreservation_provider'] = $restaurantModel->getResreservation_provider(); $resdata['res_status'] = $restaurantModel->getRes_status(); $resdata['resrestaurant_status'] = $restaurantModel->getResrestaurant_status(); $resdata['resapprovalstatus'] = $restaurantModel->getResapprovalstatus(); $resdata['resgooglemapstatus'] = $restaurantModel->getResgooglemapstatus(); $resdata['reslocation'] = $restaurantModel->getReslocation(); $resdata['restimings'] = $restaurantModel->getRestimings(); $resdata['rescreateddatetime'] = $restaurantModel->getRescreateddatetime(); $resdata['rescreatedby'] = $restaurantModel->getRescreatedby(); $resdata['resupdatedby'] = $restaurantModel->getResupdatedby(); $resdata['resupdateddatetime'] = $restaurantModel->getResupdateddatetime(); $resdata['resexecutive_chef'] = $restaurantModel->getResexecutive_chef(); $resdata['resaccept_walkin'] = $restaurantModel->getResaccept_walkin(); $resdata['resmenu'] = $restaurantModel->getResmenu(); $resdata['rescategory_id'] = $restaurantModel->getRescategory_id(); $resdata['reslisted_restaurant_id'] = $restaurantModel->getReslisted_restaurant_id(); $resdata['resorigin_id'] = $restaurantModel->getResorigin_id(); $resdata['respaymentstatus'] = $restaurantModel->getRespaymentstatus(); $resdata['resspecial_request'] = $restaurantModel->getResspecial_request(); $resdata['reslandmark'] = $restaurantModel->getReslandmark(); $resdata['resavg_mealprice_max'] = $restaurantModel->getResavg_mealprice_max(); $resdata['resavg_mealprice_min'] = $restaurantModel->getResavg_mealprice_min(); $resdata['resdelivery'] = $restaurantModel->getResdelivery(); $resdata['resair_conditioned'] = $restaurantModel->getResair_conditioned(); $resdata['reslunch_buffet'] = $restaurantModel->getReslunch_buffet(); $resdata['resdinner_buffet'] = $restaurantModel->getResdinner_buffet(); $resdata['reswifi'] = $restaurantModel->getReswifi(); $resdata['resalcohol'] = $restaurantModel->getResalcohol(); $resdata['res_smoking'] = $restaurantModel->getRes_smoking(); $resdata['resparty_allowed'] = $restaurantModel->getResparty_allowed(); $resdata['rescatering'] = $restaurantModel->getRescatering(); $resdata['reskids_section'] = $restaurantModel->getReskids_section(); $resdata['resgoogle_place_id'] = $restaurantModel->getResgoogle_place_id(); $resdata['res_social_media_fb_url'] = $restaurantModel->getRes_social_media_fb_url(); $resdata['res_likes'] = $restaurantModel->getRes_likes(); $resdata['res_specialities'] = $restaurantModel->getRes_specialities(); $resdata['res_dislikes'] = $restaurantModel->getRes_dislikes(); $resdata['res_reviews'] = $restaurantModel->getRes_reviews(); $resdata['res_social_media_twitter_url'] = $restaurantModel->getRes_social_media_twitter_url(); $resdata['resimage_data'] = $restaurantModel->getResimage_data(); $resdata['rescountry_id'] = $restaurantModel->getRescountry_id(); $resdata['res_cash'] = $restaurantModel->getRes_cash(); $resdata['res_credit_card'] = $restaurantModel->getRes_credit_card(); $resdata['res_gift_vouchers'] = $restaurantModel->getRes_gift_vouchers(); $resdata['res_visa_card'] = $restaurantModel->getRes_visa_card(); $resdata['res_master_card'] = $restaurantModel->getRes_master_card(); $resdata['resoutdoor_seating'] = $restaurantModel->getResoutdoor_seating(); $resdata['resdine_in'] = $restaurantModel->getResdine_in(); $resdata['reswheel_chair'] = $restaurantModel->getReswheel_chair(); $resdata['restelevision'] = $restaurantModel->getRestelevision(); $resdata['res_sports_telecast'] = $restaurantModel->getRes_sports_telecast(); $resdata['reslive_music'] = $restaurantModel->getReslive_music(); $resdata['resromantic_setup'] = $restaurantModel->getResromantic_setup(); $resdata['res_special_ocassion_dining'] = $restaurantModel->getRes_special_ocassion_dining(); $resdata['resparking_valet'] = $restaurantModel->getResparking_valet(); $resdata['resparking_public'] = $restaurantModel->getResparking_public(); $resdata['resparking_prepaid'] = $restaurantModel->getResparking_prepaid(); $resdata['resbreakfast_buffet'] = $restaurantModel->getResbreakfast_buffet(); $resdata['res_social_media_instagram_url'] = $restaurantModel->getRes_social_media_instagram_url(); $resdata['restags'] = $restaurantModel->getRestags(); $resdata['resnon_veg'] = $restaurantModel->getResnon_veg(); $resdata['res_status'] = 1; $resdata['resvanity_url'] = $this->getVantiyUrl($restaurantModel->getResname() . " " . $location_name); $timezoneMapper = new Application_Model_TimezonebdMapper(); $current_timezone = $timezoneMapper->fetchById($restaurantModel->getRestimezone()); date_default_timezone_set($current_timezone); $resdata['rescreateddatetime'] = date("Y-m-d H:i:s"); $resid = $db->insert($resdata); if (is_int($resid)) { $restypeArray = $restaurantModel->getRestype_id(); $dataArray = array(); $cusineDataMapper = new Restaurant_Model_RestaurantCusineDataMapper(); if (is_array($restypeArray)) { foreach ($restypeArray as $key => $value) { $cusineDataMapper->save(array('restaurant_fk_resid' => $resid, 'restaurant_type_fk_id' => $value)); } } } return $resid; } catch (Exception $e) { throw new Exception($e->getMessage()); } }