projects
/
Pman.Core
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
897f74b
)
sync
author
john
<john@roojs.com>
Thu, 11 Oct 2018 06:22:53 +0000
(14:22 +0800)
committer
john
<john@roojs.com>
Thu, 11 Oct 2018 06:22:53 +0000
(14:22 +0800)
DataObjects/Core_setting.php
patch
|
blob
|
history
diff --git
a/DataObjects/Core_setting.php
b/DataObjects/Core_setting.php
index
34936e5
..
a0eae02
100644
(file)
--- a/
DataObjects/Core_setting.php
+++ b/
DataObjects/Core_setting.php
@@
-85,16
+85,17
@@
class Pman_Core_DataObjects_Core_setting extends DB_DataObject
return;
}
return;
}
+ $this->initKeys();
+
$c = $this->lookup($a['module'], $a['name']);
$c = $this->lookup($a['module'], $a['name']);
- if($c) {
- return;
- }
- $
this->initKeys(
);
+ $
o = clone($c
);
- $s = DB_DataObject::factory('core_setting');
+ if(empty($c)) {
+ $c = DB_DataObject::factory('core_setting');
+ }
- $
s
->setFrom(array(
+ $
c
->setFrom(array(
'module' => $a['module'],
'name' => $a['name'],
'description' => $a['description'],
'module' => $a['module'],
'name' => $a['name'],
'description' => $a['description'],
@@
-104,7
+105,7
@@
class Pman_Core_DataObjects_Core_setting extends DB_DataObject
'is_valid' => 1
));
'is_valid' => 1
));
-
$s->insert(
);
+
empty($o) ? $c->insert() : $c->update($o
);
}
//one key for encrypting all the settings
}
//one key for encrypting all the settings