$c = $this->lookup($a['module'], $a['name']);
- $o = clone($c);
+ $o = $c ? clone($c) : false;
- if(empty($c)) {
- $c = DB_DataObject::factory('core_setting');
- }
+ $c = $c ? $c : DB_DataObject::factory('core_setting');
$c->setFrom(array(
'module' => $a['module'],
'is_valid' => 1
));
- empty($o) ? $c->insert() : $c->update($o);
+ $o ? $c->update($o) : $c->insert();
}
//one key for encrypting all the settings