From 60da6c817a52490b84c52ce48a01745ffb9ada19 Mon Sep 17 00:00:00 2001 From: Chuck Hagenbuch Date: Sun, 12 Apr 2009 23:33:48 -0400 Subject: [PATCH] Add fetch() method compatible with PDO fetch() methods --- framework/Db/lib/Horde/Db/Adapter/Mysqli/Result.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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 -- 2.11.0