<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Activity_log_model extends Base_Model {

	function __construct() {

        parent::__construct();
		$this->set_schema('public');
		$this->set_table('activityLog');
		$this->set_pk('idActivityLog');
		$this->set_log(false);
	}
	
	function getByToken($token){
		$query=
<<<EOT
SELECT * 
FROM "public"."activityLog" 
WHERE "LogData"->>'Token' = '$token'
EOT;
		$log = $this->db->query($query)->row_array();
		if (!isset($log['idActivityLog'])) {
			$log = $this->feed_blank();
		}
		return $log;
	}
}