This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "quickfw".
The branch, master has been updated
via 051454035ba7290215e818d1c6ca33b83f008fd9 (commit)
from 7fca8066db3977af062c22a09b07835bd87ef229 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 051454035ba7290215e818d1c6ca33b83f008fd9
Author: Ivan1986 <iva...@li...>
Date: Wed Mar 31 15:31:00 2010 +0400
Поддержка выбора классами в DbSimple
diff --git a/lib/DbSimple/Generic.php b/lib/DbSimple/Generic.php
index c4293c8..8fbbcb8 100644
--- a/lib/DbSimple/Generic.php
+++ b/lib/DbSimple/Generic.php
@@ -273,6 +273,22 @@ abstract class DbSimple_Generic_Database extends DbSimple_Generic_LastError
}
/**
+ * Задает имя класса строки
+ *
+ * <br>для следующего запроса каждая строка будет
+ * заменена классом, конструктору которого передается
+ * массив поле=>значение для этой строки
+ *
+ * @param string $name имя класса
+ * @return DbSimple_Generic_Database указатель на себя
+ */
+ public function setClassName($name)
+ {
+ $this->_className = $name;
+ return $this;
+ }
+
+ /**
* array getStatistics()
* Returns various statistical information.
*/
@@ -507,6 +523,13 @@ abstract class DbSimple_Generic_Database extends DbSimple_Generic_LastError
$total = call_user_func_array(array(&$this, 'selectCell'), $query);
}
+ if ($this->_className)
+ {
+ foreach($result as $k=>$v)
+ $result[$k] = new $this->_className($v);
+ $this->_className = '';
+ }
+
return $result;
}
@@ -1093,6 +1116,7 @@ abstract class DbSimple_Generic_Database extends DbSimple_Generic_LastError
);
private $_cachePrefix = '';
+ private $_className = '';
private $_logger = null;
private $_cacher = null;
-----------------------------------------------------------------------
Summary of changes:
lib/DbSimple/Generic.php | 24 ++++++++++++++++++++++++
1 files changed, 24 insertions(+), 0 deletions(-)
hooks/post-receive
--
quickfw
|