Add fetchObject method to Firebird_result class

This commit is contained in:
Timothy Warren 2012-04-18 11:34:24 -04:00
parent 3c74f243fe
commit 5a4f6a3455
2 changed files with 14 additions and 0 deletions

View File

@ -30,6 +30,7 @@ class Firebird_Result extends PDOStatement {
public function __construct($link) public function __construct($link)
{ {
$this->statement = $link; $this->statement = $link;
$this->setFetchMode(PDO::FETCH_ASSOC);
} }
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
@ -163,6 +164,19 @@ class Firebird_Result extends PDOStatement {
$row = $this->fetch(PDO::FETCH_NUM); $row = $this->fetch(PDO::FETCH_NUM);
return $row[$column_num]; return $row[$column_num];
} }
// --------------------------------------------------------------------------
/**
* Emulate PDOStatement::fetchObject, but only for the default use
*
* @param int $colum_num
* @return mixed
*/
public function fetchObject($class_name='stdClass', $ctor_args=array())
{
return $this->fetch(PDO::FETCH_OBJ);
}
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------

Binary file not shown.