This commit is contained in:
Frederic Guillot
2016-03-24 20:43:07 -04:00
parent 725b7d2a55
commit 3a06e0ab21
5 changed files with 62 additions and 43 deletions

View File

@@ -88,9 +88,18 @@ abstract class Setting extends Base
foreach ($values as $option => $value) {
if ($this->exists($option)) {
$results[] = $this->db->table(self::TABLE)->eq('option', $option)->update(array('value' => $value, 'changed_on' => $timestamp, 'changed_by' => $user_id));
$results[] = $this->db->table(self::TABLE)->eq('option', $option)->update(array(
'value' => $value,
'changed_on' => $timestamp,
'changed_by' => $user_id,
));
} else {
$results[] = $this->db->table(self::TABLE)->insert(array('option' => $option, 'value' => $value, 'changed_on' => $timestamp, 'changed_by' => $user_id));
$results[] = $this->db->table(self::TABLE)->insert(array(
'option' => $option,
'value' => $value,
'changed_on' => $timestamp,
'changed_by' => $user_id,
));
}
}