$watches = $w->fetchAll();
- //print_R($watches);exit;
+ print_R($watches);exit;
$nn = DB_DataObject::Factory('core_notify');
$nn->ontable = $event->on_table;
// does this watch already have a flag...
$nf = clone($n);
- $nf->whereAdd("sent ><'2000-01-01'");
+ $nf->whereAdd("sent < '2000-01-01'");
//$nf->whereAdd('sent < act_when');
if ($nf->count()) {
// we have a item in the queue for that waiting to be sent..
}
+ function initDatabase($roo, $data) {
+ foreach($data as $d) {
+ $dd = $d;
+ if (isset($dd['active'])) {
+ unset($dd['active']);
+ }
+ $t = DB_DataObject::Factory($this->tableName());
+ $t->setFrom($dd);
+ if ($t->find(true)) {
+ continue;
+ }
+ $t = DB_DataObject::Factory($this->tableName());
+ $t->setFrom($d);
+ $t->insert();
+
+
+ }
+ }
}