diff options
author | Timo Litzbarski <tili2@gmx.de> | 2016-03-11 11:59:23 +0000 |
---|---|---|
committer | BlueTeck <tili2@gmx.de> | 2016-03-13 19:50:47 +0100 |
commit | 194fbe263e2a862d3bb341ccbadd724f8d8b79e4 (patch) | |
tree | eb16902f1f1527a319ab38ab67f64336856dc476 /app/Model/Setting.php | |
parent | 7d7b9f78b8889e95146f4c8c96b80b0920f9038c (diff) |
user and data for metadata + settings
user and date for metadata #1853 #1861
Diffstat (limited to 'app/Model/Setting.php')
-rw-r--r-- | app/Model/Setting.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/app/Model/Setting.php b/app/Model/Setting.php index 6d29c6ec..4e1c1b0b 100644 --- a/app/Model/Setting.php +++ b/app/Model/Setting.php @@ -81,14 +81,16 @@ abstract class Setting extends Base { $results = array(); $values = $this->prepare($values); + $user_id = $this->userSession->getId(); + $timestamp = time(); $this->db->startTransaction(); foreach ($values as $option => $value) { if ($this->exists($option)) { - $results[] = $this->db->table(self::TABLE)->eq('option', $option)->update(array('value' => $value)); + $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)); + $results[] = $this->db->table(self::TABLE)->insert(array('option' => $option, 'value' => $value, 'changed_on' => $timestamp, 'changed_by' => $user_id)); } } |