$w->selectAdd('distinct(person_id) as person_id');
$people = $w->fetchAll('person_id');
+ $nn = DB_DataObject::Factory('core_notify');
+ $nn->ontable = $event->on_table;
+ $nn->onid = $event->on_id;
+ foreach($people as $p) {
+ if (!$p) { // no people??? bugs in watch table
+ continue;
+ }
+ $n = clone($nn);
+ $n->person_id = $p;
+ $nf = clone($n);
+ $nf->whereAdd('sent < act_when');
+ if ($nf->count()) {
+ // we have a item in the queue for that waiting to be sent..
+ continue;
+ }
+ $n->act_start( date("Y-m-d H:i:s") );
+ $n->insert();
+
+
+ }