return;
}
+ $this->initKeys();
+
$c = $this->lookup($a['module'], $a['name']);
- if($c) {
- return;
- }
- $this->initKeys();
+ $o = $c ? clone($c) : false;
- $s = DB_DataObject::factory('core_setting');
+ $c = $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();
+ $o ? $c->update($o) : $c->insert();
}
//one key for encrypting all the settings