Example #1
0
 public function EditSourceofRestaurant(User_Model_Manager $obj)
 {
     try {
         $db = Zend_Db_Table::getDefaultAdapter();
         $status = false;
         if ($obj->getSourceid()) {
             $set = array('rsosourceid' => $obj->getSourceid(), 'rsosourcedescription' => $obj->getSourcedescription());
             $where = $db->quoteInto('rsofk_user = ?', $obj->getId());
             $rows_affected = $this->getDbTable()->update($set, $where);
         } else {
             $set = array('rsosourceid' => null, 'rsosourcedescription' => null);
             $where = $db->quoteInto('rsofk_user = ?', $obj->getId());
             $rows_affected = $this->getDbTable()->update($set, $where);
         }
         if ($rows_affected > 0) {
             $status = true;
         }
         return $status;
     } catch (Exception $ex) {
         throw new Exception($ex->getMessage());
     }
 }