"", "expires_time" => "" ); public function get_model(){ return $this->model; } public function find_token($token,$time) { $this->clear_token($time); $token_info = $this->mongo_db->where("token", $token)->where_gt("expires_time", $time)->find_one($this->collection_name); return $token_info; } public function clear_token($time){ return $this->mongo_db->where_lt("expires_time", $time)->delete_all($this->collection_name); } public function save_token($token){ return $this->mongo_db->insert($this->collection_name,$token); } public function delete_token($token){ return $this->mongo_db->where("token",$token)->delete($this->collection_name); } }