<?php
    defined('BASEPATH') OR exit('No direct script access allowed');
/**
 * Created by PhpStorm.
 * User: Hanry Nzale
 * Date: 05/08/2018
 * Time: 00:22
 */

class Authentification_url_model extends CI_Model
{

    public function getExpireDate($token){

        $this->db->select('expire_at');
        $this->db->from('authentification_url');
        $this->db->where('token',$token);
        $query=$this->db->get();

        if($query->num_rows()>0){
            return $this->db->get()->row()->expire_at;
        }else{
            return null;
        }

    }

    public function save_auth($auth){

        $this->db->insert('authentification_url', $auth);
        return $this->db->insert_id();
    }

}