diff options
author | robocoder <anthon.pang@gmail.com> | 2010-04-06 18:51:05 +0400 |
---|---|---|
committer | robocoder <anthon.pang@gmail.com> | 2010-04-06 18:51:05 +0400 |
commit | 4e0b54eb197dddfe99475963989982aea0ab581e (patch) | |
tree | c6de1c2c262335660ef0e6380ed77b2970d859c2 /core/Tracker/Db.php | |
parent | 2b6d6aaa105f4a7521ae5ef5f1bd9354178afc0a (diff) |
fixes #882 - Piwik_Query() can now be used by tracker plugins;
fixes #1292 - remove (deprecated/unused) Piwik_Quote() since we use Zend_Db for prepared statements; add Piwik_FetchRow() for completeness
git-svn-id: http://dev.piwik.org/svn/trunk@2054 59fd770c-687e-43c8-a1e3-f5a4ff64c105
Diffstat (limited to 'core/Tracker/Db.php')
-rw-r--r-- | core/Tracker/Db.php | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/core/Tracker/Db.php b/core/Tracker/Db.php index 01291712d1..d2a0c7299c 100644 --- a/core/Tracker/Db.php +++ b/core/Tracker/Db.php @@ -155,6 +155,25 @@ abstract class Piwik_Tracker_Db } /** + * This function is a proxy to fetch(, used to maintain compatibility with Zend_Db interface + * @see fetch() + */ + public function fetchOne( $query, $parameters = array() ) + { + $result = $this->fetch($query, $parameters); + return is_array($result) ? $result[0] : false; + } + + /** + * This function is a proxy to fetch(, used to maintain compatibility with Zend_Db + PDO interface + * @see fetch() + */ + public function exec( $query, $parameters = array() ) + { + return $this->fetch($query, $parameters); + } + + /** * Return number of affected rows in last query * * @param mixed $queryResult Result from query() |