From 359a49c4122ec19b949fa54cfab3aad8dac02463 Mon Sep 17 00:00:00 2001 From: pzinovkin Date: Tue, 23 Mar 2010 15:47:32 +0000 Subject: [PATCH] fetchPairs method, #16 git-svn-id: svn+ssh://code.netmonsters.ru/svn/majestic/branches/evo@133 4cb57b5f-5bbd-dd11-951b-001d605cbbc5 --- model/DbStatement.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/model/DbStatement.php b/model/DbStatement.php index 0386c24..d5a3200 100644 --- a/model/DbStatement.php +++ b/model/DbStatement.php @@ -151,6 +151,14 @@ abstract class DbStatement return false; } + public function fetchPairs() + { + while ($row = $this->fetch(Db::FETCH_NUM)) { + $data[$row[0]] = $row[1]; + } + return $data; + } + /* Abstract methods */ abstract public function fetch($style = Db::FETCH_OBJ);