<?php 
class Fav_Model extends Model{
	function __construct(){
		parent::__construct();	
	}
	function add($data){
		return $this->db->insert("fav",$data);
	}
	function getfav($data){
		return $this->db->getwhere("fav",$data);
	}
	function getFavs($memberid){
		$this->db->select("f.*,s.thumb,s.title");
		$this->db->join("search_cache as s","s.content_id","f.content_id");
		$this->db->where("f.memberid",$memberid);
		return $this->db->get("fav as f");
	}
	function delete($favids,$memberid){
		$this->db->where("memberid",$memberid);
		$this->db->in("id",$favids);
		return $this->db->delete("fav");
	}
}