ee2-rest
ee2-rest copied to clipboard
Creating default object from empty value
I got problem when I started to upgrade my php version to 5.3.2 up but when I using 5.3.1 it works fine!
A PHP Error was encountered Severity: Warning Message: Creating default object from empty value Filename: controllers/crew_controller.php Line Number: ABC
Here is my API
class Crew_controller extends MY_rest_controller
{
/**
* Returns a single Crew.
*
* @return xml
*/
function crew_get()
{
$load = 'crew_id';
if ($this->get('id') != '') {
$id = $this->get('id');
elseif ($this->get('hash') != '') {
$id = $this->get('hash');
$load = 'hash';
}
$cache = Cache::get_instance();
$crew = $cache::get('crew' . $id);
if (!$crew) {
$crew = new Crew($id);
$crew->load($id, $load);
$cache::save('crew' . $crew->crew_id, $crew, 1800);
}
$response = $crew->getData();
$this->response($response);
}
}
And here is my FRONT Controller
class Crew_controller extends Front_Controller
{
public function crew_registration($crew = null)
{
$personal = $this->rest->get('crew', array('hash' => $crew), 'json');
$personal->first_name = $profile->first_name; ->>>>> LINE ABC
$personal->last_name = $profile->last_name;
$personal->thumbnail_url = $profile->thumbnail_url;
}
}