Implement more of PDOStatement in Firebird_Result class

This commit is contained in:
Timothy Warren 2012-04-18 10:39:01 -04:00
parent f03afaa98b
commit 3c74f243fe
2 changed files with 77 additions and 21 deletions

View File

@ -31,6 +31,71 @@ class Firebird_Result extends PDOStatement {
{ {
$this->statement = $link; $this->statement = $link;
} }
// --------------------------------------------------------------------------
/**
* Invalidate method for data consistency
*
* @param mixed $column
* @param mixed &$param
* @return FALSE
*/
public function bindColumn($column, &$param, $type=NULL, $maxlen=NULL, $driverdata=NULL)
{
return FALSE;
}
// --------------------------------------------------------------------------
/**
* Invalidate method for data consistency
*
* @param mixed $parameter
* @param mixed &$variable
* @param int $data_type
* @return FALSE
*/
public function bindParam($parameter, &$variable, $data_type=NULL, $maxlen=NULL, $driverdata=NULL)
{
return FALSE;
}
// --------------------------------------------------------------------------
/**
* Invalidate method for data consistency
*
* @param mixed $parameter
* @param mixed &$variable
* @param int $data_type
* @return FALSE
*/
public function bindValue($parameter, $variable, $data_type=NULL)
{
return FALSE;
}
// --------------------------------------------------------------------------
/**
* Run a prepared statement query
*
* @param array $args
* @return bool
*/
public function execute($args = NULL)
{
//Add the prepared statement as the first parameter
array_unshift($args, $this->statement);
// Let php do all the hard stuff in converting
// the array of arguments into a list of arguments
// Then pass the resource to the constructor
$this->__construct(call_user_func_array('fbird_execute', $args));
return $this;
}
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
@ -101,27 +166,6 @@ class Firebird_Result extends PDOStatement {
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
/**
* Run a prepared statement query
*
* @param array $args
* @return bool
*/
public function execute($args = NULL)
{
//Add the prepared statement as the first parameter
array_unshift($args, $this->statement);
// Let php do all the hard stuff in converting
// the array of arguments into a list of arguments
// Then pass the resource to the constructor
$this->__construct(call_user_func_array('fbird_execute', $args));
return $this;
}
// --------------------------------------------------------------------------
/** /**
* Return the number of rows affected by the previous query * Return the number of rows affected by the previous query
* *
@ -143,6 +187,18 @@ class Firebird_Result extends PDOStatement {
{ {
return count($this->fetchAll()); return count($this->fetchAll());
} }
// --------------------------------------------------------------------------
/**
* Method to emulate PDOStatement->errorCode
*
* @return string
*/
public function errorCode()
{
return fbird_errcode();
}
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------

Binary file not shown.