Beispiel #1
0
 public function updateDiningBdm($request)
 {
     try {
         $action = $request->perform;
         $data = array();
         foreach ($request->data as $value) {
             $data[$value['name']] = $value['value'];
         }
         $diningMapper = new Application_Model_RestaurantDiningStylebdMapper();
         switch ($action) {
             case "append":
                 $code = $data['code'];
                 $isdine = $diningMapper->verifyCode($code, 0);
                 if ($isdine) {
                     $status = $diningMapper->addDining($data);
                     return $status;
                 } else {
                     return 'f';
                 }
                 break;
             case "update":
                 $status = $diningMapper->updateDine($data);
                 return $status;
                 break;
         }
     } catch (Exception $ex) {
         Rdine_Logger_FileLogger::info($ex->getMessage());
         throw new Exception($ex->getMessage());
     }
 }