<?php

if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}

/**
 * Description of Rtform_request_tmodel
 *
 * @author CIEXT skeleton
 */
class Rtform_request_tmodel extends \Ciext\Model\AbstractTableModel
{

    protected $table = 'rtform_request';
    protected $pkey = 'id_rtform_request';

    public function __construct()
    {
        parent::__construct();

        $this->attach($this->load->library('rtform/rtform_mail_event'));
    }

    public function add_data($id, array $data)
    {
        return $this->add([
            'id_rtform' => (int)$id,
            'date'      => date('Y-m-d H:i:s'),
            'data'      => json_encode($data),
        ]);
    }
}
