Custom Event in PHP gives "Trying to get property of non-object in"

I have the below code on my custom event and i invoke it async from iOS.
I get “Trying to get property of non-object in…”

$query = new BackendlessDataQuery();


$condition = "column.objectId='" . $result_collection[0]->ObjectId ."'";


$query->setWhereClause( $condition );
$result_collection = Backendless::$Data->of('Table')->find( $query )->getAsArray();

Hi Hrisafis,

You can’t access BackendlessCollection’s element by index directly: $result_collection[0]
You need to use getAsArray here, too: $result_collection->getAsArray[0]