I'm having a problem getting the values from a pointer column. There is a column named "User" that points to the "_User" class in parse. I'm attempting to get the username associated with each row in my locations database. But for some reason, I'm getting a strange response.
Call to a member function get() on a non-object
My code is:
$query = new ParseQuery("SignoutDestination");
$query->includeKey("User");
// Limit what could be a lot of points.
$query->limit(100);
// Final array of objects
$signoutdestinations = $query->find();
foreach($signoutdestinations as $obj){
echo $obj->get("User")->get("username");
}
Has there been a change in the SDK or anything that could be causing this? Or am I doing something wrong?
get()it is... Is$objactually an object? I'dvar_dump($obj)orgettype($obj)to see. If it is, the call$obj->get('User')might not be returning an object. I'd try to debug by deduction there.$obj->get('User')returns an array of objects. If so, you'll have to iterate over that result set and call->get('username')on each object.arrayis not an object and does not have aget()method, or any method for that matter.