- Use create Behavior to call remote api by using HttpSocket
function getCategoriesFromAPI(){
// for example
$results = $HttpSocket->get('http://www.google.com/search', 'q=cakephp');
return $result;
}
- Use that Behavior in model
var $actsAs = array('MyRemoteAPI');
- Stop using existing model functions/methods, use the ones in Behavior instead
$data = $this->Category->getCategoriesFromAPI();