Exemplo n.º 1
0
 /**
  * Perform an SQL delete by an id
  *
  * @param integer $id
  * 
  * @return B2DBResultset
  */
 public function doDeleteById($id)
 {
     try {
         $crit = new B2DBCriteria();
         $crit->setFromTable($this);
         $crit->addWhere($this->id_column, $id);
         $crit->generateDeleteSQL();
         $statement = B2DBStatement::getPreparedStatement($crit);
         $resultset = $statement->performQuery('delete');
         return $resultset;
     } catch (Exception $e) {
         if (B2DB::throwExceptionAsHTML()) {
             B2DB::fatalError($e);
             exit;
         } else {
             throw $e;
         }
     }
 }