I don't know how many of you are familiar with the parse.com platform, but I am utilizing the third party php library that is linked on their website and I am running into a couple problems.
Link: Parse.com PHP Library
I am trying to query my db but it keeps returning Notice: Trying to get property of non-object. From what I can see my code is correct but the error originates from one of the files included in the library.
Here is my code thus far:
function storeInParseDB ($message, $unit) {
$parse = new parseQuery($class = 'PushNotifications');
$parse->whereEqualTo('unit', $unit);
$result = $parse->find();
echo "RESULT: ";
print_r($result);
}
Code that is throwing the error:
private function checkResponse($response,$responseCode,$expectedCode){
//TODO: Need to also check for response for a correct result from parse.com
if($responseCode != $expectedCode){
$error = json_decode($response);
$this->throwError($error->error,$error->code);
}
else{
//check for empty return
if($response == '{}'){
return true;
}
else{
return json_decode($response);
}
}
}
Any help would be greatly appreciated.