From 9f0114c08b9aad119e1a996b1bfd4d41f3298167 Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Mon, 9 Mar 2020 21:51:50 +0100 Subject: [PATCH] Set values for consent "created" and "modified" columns. --- src/application/models/Consents_model.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/application/models/Consents_model.php b/src/application/models/Consents_model.php index a9bca67a..f5375d14 100644 --- a/src/application/models/Consents_model.php +++ b/src/application/models/Consents_model.php @@ -74,7 +74,8 @@ class Consents_model extends CI_Model { */ protected function _insert($consent) { - $this->db->set('created', 'NOW()', FALSE); + $consent['created'] = time(); + if ( ! $this->db->insert('ea_consents', $consent)) { throw new Exception('Could not insert consent to the database.'); @@ -96,6 +97,8 @@ class Consents_model extends CI_Model { */ protected function _update($consent) { + $consent['modified'] = time(); + if ( ! $this->db->update('ea_consents', $consent, ['id' => $consent['id']])) { throw new Exception('Could not update consent to the database.');