Example #1
0
File: model.php Project: summea/mi
 public function destroy($id)
 {
     try {
         if (empty($id)) {
             throw new Exception('No id to destroy!');
         } else {
             $db = Model::openDBConnection();
             if (isset($id)) {
                 // DELETE QUERY
                 $query = sprintf("delete from %s where id=%d", $this->useTable, $id);
             }
             $query = $this->execute($query);
             return $return_this;
         }
     } catch (Exception $e) {
         myExceptionHandler($e);
     }
 }