From: Chuck Hagenbuch Date: Mon, 13 Apr 2009 03:33:48 +0000 (-0400) Subject: Add fetch() method compatible with PDO fetch() methods X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=60da6c817a52490b84c52ce48a01745ffb9ada19;p=horde.git Add fetch() method compatible with PDO fetch() methods --- diff --git a/framework/Db/lib/Horde/Db/Adapter/Mysqli/Result.php b/framework/Db/lib/Horde/Db/Adapter/Mysqli/Result.php index 7a641979b..c6b85eed9 100644 --- a/framework/Db/lib/Horde/Db/Adapter/Mysqli/Result.php +++ b/framework/Db/lib/Horde/Db/Adapter/Mysqli/Result.php @@ -168,6 +168,19 @@ class Horde_Db_Adapter_Mysqli_Result implements Iterator } /** + * Return the current row and advance the recordset one row. + */ + public function fetch() + { + if (!$this->valid()) { + return null; + } + $row = $this->current(); + $this->next(); + return $row; + } + + /** * Implementation of the valid() method for iterator * * @return boolean Whether the iteration is valid