[eluser]mabright[/eluser]
When ever I reference my library class, I receive an error. The error is referring to one of my models but I do not use the model in my library.
Code:
A PHP Error was encountered
Severity: Notice
Message: Undefined property: Yelp::$Location_model
Filename: libraries/Loader.php
Line Number: 1035
Fatal error: Call to a member function _assign_libraries() on a non-object in
Yelp class:
Code:
class Yelp {
var $CI;
public function __construct()
{
$this->CI =& get_instance();
}
public function get_locations($url)
{
$results = $this->parse_response(file_get_contents($url, "r"));
return $results;
}
public function build_url($search_term,$location,$categories)
{
$loc = str_replace(' ',' ',$location);
$url = 'http://api.yelp.com/business_review_search?term='.$search_term;
$url .= '&location;='.$loc;
$url .= '&limit=2&ywsid;='.$this->CI->config->item('yelp_devkey');
$url .= '&category;='.$categories;
return $url;
}
private function parse_response($response)
{
$results = $this->__unserialize($response);
return $results;
}
private function __unserialize($sObject)
{
$sObject = ereg_replace("\n", " ", $sObject);
$sObject=htmlspecialchars_decode($sObject);
return preg_replace('!s:(\d+):"(.*?)";!e', "'s:'.strlen('$2').':\"$2\";'", $sObject );
}
}