Permalink
Browse files

Faster to always specify fetch class

  • Loading branch information...
1 parent b117103 commit ff3499619f0bc85608e9994c83c617d3aef59368 @cbandy committed Feb 14, 2010
Showing with 6 additions and 4 deletions.
  1. +6 −4 classes/kohana/database/postgresql/result.php
@@ -10,6 +10,11 @@ public function __construct($result, $sql, $as_object, $total_rows = NULL)
{
parent::__construct($result, $sql, $as_object);
+ if ($as_object === TRUE)
+ {
+ $this->_as_object = 'stdClass';
+ }
+
if ($total_rows !== NULL)
{
$this->_total_rows = $total_rows;
@@ -92,10 +97,7 @@ public function current()
if ( ! $this->_as_object)
return pg_fetch_assoc($this->_result, $this->_current_row);
- if (is_string($this->_as_object))
- return pg_fetch_object($this->_result, $this->_current_row, $this->_as_object);
-
- return pg_fetch_object($this->_result, $this->_current_row);
+ return pg_fetch_object($this->_result, $this->_current_row, $this->_as_object);
}
}

0 comments on commit ff34996

Please sign in to comment.