The "created" and "modified" consent fields are date time and they need a proper date time value

This commit is contained in:
Alex Tselegidis 2020-09-23 13:36:24 +03:00
parent ed262c2e9a
commit 10df66fddb

View file

@ -28,6 +28,8 @@ class Consents_model extends CI_Model {
* @param array $consent Associative array with the consent's data. * @param array $consent Associative array with the consent's data.
* *
* @return int Returns the consent ID. * @return int Returns the consent ID.
*
* @throws Exception
*/ */
public function add($consent) public function add($consent)
{ {
@ -77,8 +79,8 @@ class Consents_model extends CI_Model {
*/ */
protected function insert($consent) protected function insert($consent)
{ {
$consent['created'] = time(); $consent['created'] = date('Y-m-d H:i:s');
$consent['modified'] = time(); $consent['modified'] = date('Y-m-d H:i:s');
if ( ! $this->db->insert('consents', $consent)) if ( ! $this->db->insert('consents', $consent))
{ {
@ -101,7 +103,7 @@ class Consents_model extends CI_Model {
*/ */
protected function update($consent) protected function update($consent)
{ {
$consent['modified'] = time(); $consent['modified'] = date('Y-m-d H:i:s');
if ( ! $this->db->update('consents', $consent, ['id' => $consent['id']])) if ( ! $this->db->update('consents', $consent, ['id' => $consent['id']]))
{ {