DataObjects/Core_watch.php
authorAlan Knowles <alan@akbkhome.com>
Sun, 28 Oct 2012 13:37:03 +0000 (21:37 +0800)
committerAlan Knowles <alan@akbkhome.com>
Sun, 28 Oct 2012 13:37:03 +0000 (21:37 +0800)
DataObjects/Core_watch.php

index d370835..42f521d 100644 (file)
@@ -77,11 +77,14 @@ class Pman_Core_DataObjects_Core_watch extends DB_DataObject
     /**
      * Generate a notify event based on watches (matching whereAdd)
      *
+     * Usage: $core_watch->notify('mtrack_repos', 1, '1=1')
      */
-    function notify($ontable , $onid, $whereAdd)
+    function notify($ontable , $onid, $whereAdd = false)
     {
         $w = DB_DataObject::factory('core_watch');
-        $w->whereAdd($whereAdd);
+        if ($whereAdd !== false) { 
+            $w->whereAdd($whereAdd  );
+        }
         $w->selectAdd();
         $w->selectAdd('distinct(person_id) as person_id');
         $people = $w->fetchAll('person_id');