Set values for consent "created" and "modified" columns.

This commit is contained in:
Alex Tselegidis 2020-03-09 21:51:50 +01:00
parent 21ab3428a5
commit 9f0114c08b

View file

@ -74,7 +74,8 @@ class Consents_model extends CI_Model {
*/ */
protected function _insert($consent) protected function _insert($consent)
{ {
$this->db->set('created', 'NOW()', FALSE); $consent['created'] = time();
if ( ! $this->db->insert('ea_consents', $consent)) if ( ! $this->db->insert('ea_consents', $consent))
{ {
throw new Exception('Could not insert consent to the database.'); throw new Exception('Could not insert consent to the database.');
@ -96,6 +97,8 @@ class Consents_model extends CI_Model {
*/ */
protected function _update($consent) protected function _update($consent)
{ {
$consent['modified'] = time();
if ( ! $this->db->update('ea_consents', $consent, ['id' => $consent['id']])) if ( ! $this->db->update('ea_consents', $consent, ['id' => $consent['id']]))
{ {
throw new Exception('Could not update consent to the database.'); throw new Exception('Could not update consent to the database.');