return;
}
+ $this->initKeys();
+
$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'],
'is_valid' => 1
));
- $s->insert();
+ empty($o) ? $c->insert() : $c->update($o);
}
//one key for encrypting all the settings