X-Git-Url: http://git.roojs.org/?p=Pman.Core;a=blobdiff_plain;f=DataObjects%2FCore_watch.php;h=ab6a481b749393f74a4c885cb466f7cded457fd3;hp=149bba38bde7c29d211ef5bc8cbbd045502e69cb;hb=464c1063e1b0633d402d5701720be6f8b6136949;hpb=cabd9aaf8733f471e9b0a8aa955aa77072ece6e2 diff --git a/DataObjects/Core_watch.php b/DataObjects/Core_watch.php index 149bba38..ab6a481b 100644 --- a/DataObjects/Core_watch.php +++ b/DataObjects/Core_watch.php @@ -217,6 +217,24 @@ class Pman_Core_DataObjects_Core_watch extends DB_DataObject } + 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 ($dd->find(true)) { + continue; + } + $t = DB_DataObject::Factory($this->tableName()); + $t->setFrom($d); + $t->insert(); + + + } + } }