<?php
class Directory_Category_Link extends MY_Model
{
    const DB_TABLE = 'directory_companies_categories';
    const DB_TABLE_PK = 'directory_company_category_id';

    function LoadByCompanyCategoryIDs($company_id, $category_id)
	{
	  	$query = $this->db->query("SELECT * FROM directory_companies_categories WHERE company_id=? AND category_id=?", array($company_id, $category_id));

	  	if($query->num_rows() > 0)
	  	{
	  		foreach($query->result() as $row)
	  		{
	  			//load the first item
		  		return $this->populate($row);
	  		}
	  	}
	  	else
	  	{
	  		return false;
	  	}
	}
}
