diff options
author | mattpiwik <matthieu.aubry@gmail.com> | 2008-06-21 06:53:52 +0400 |
---|---|---|
committer | mattpiwik <matthieu.aubry@gmail.com> | 2008-06-21 06:53:52 +0400 |
commit | 16e31d2bdd7c45528a99e3030072e14fe68ade02 (patch) | |
tree | 7e347e466ee219bcc082ceb6d2a3ffb7a719df51 /modules/LogStats.php | |
parent | b72536f57fcb378182588e1746a092439f782325 (diff) |
- adding hooks in LogStats modules, see http://dev.piwik.org/trac/wiki/Plugins/Hooks
git-svn-id: http://dev.piwik.org/svn/trunk@524 59fd770c-687e-43c8-a1e3-f5a4ff64c105
Diffstat (limited to 'modules/LogStats.php')
-rw-r--r-- | modules/LogStats.php | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/modules/LogStats.php b/modules/LogStats.php index 2d084c985b..fe059138b2 100644 --- a/modules/LogStats.php +++ b/modules/LogStats.php @@ -190,7 +190,20 @@ class Piwik_LogStats */ protected function getNewVisitObject() { - return new Piwik_LogStats_Visit(self::$db); + $visit = null; + Piwik_PostEvent('LogStats.getNewVisitObject', $visit); + + if(is_null($visit)) + { + $visit = new Piwik_LogStats_Visit(); + } + elseif(!($visit instanceof Piwik_LogStats_Visit_Interface )) + { + throw new Exception("The Visit object set in the plugin must implement Piwik_LogStats_Visit_Interface"); + } + + $visit->setDb(self::$db); + return $visit; } // main algorithm |