projects
/
Pman.Core
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cabd9aa
)
DataObjects/Core_watch.php
author
Alan Knowles
<alan@roojs.com>
Thu, 25 Jul 2013 10:01:14 +0000
(18:01 +0800)
committer
Alan Knowles
<alan@roojs.com>
Thu, 25 Jul 2013 10:01:14 +0000
(18:01 +0800)
DataObjects/Core_watch.php
patch
|
blob
|
history
diff --git
a/DataObjects/Core_watch.php
b/DataObjects/Core_watch.php
index
149bba3
..
ab6a481
100644
(file)
--- 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();
+
+
+ }
+ }
}