mirror of
https://github.com/alextselegidis/easyappointments.git
synced 2024-11-26 09:53:34 +03:00
Set values for consent "created" and "modified" columns.
This commit is contained in:
parent
21ab3428a5
commit
9f0114c08b
1 changed files with 4 additions and 1 deletions
|
@ -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.');
|
||||||
|
|
Loading…
Reference in a new issue