I am using facebook api with PHP to get comments on a specific post by postID
$request = new FacebookRequest(
$sess,
'GET',
'/xxxxxxxxxxxxxxxxxxxxxx/comments'
);
$response = $request->execute();
$graphObject = $response->getGraphObject();
the result when i do it with graph api is a file like that
{
"data":[
{
"id": "xxxxxxxxxxxxxxxxxxxxx",
"from": {
"id": "yyyyyyyyyyyyy",
"name": "someName"
},
"message": "commentMessage",
"can_remove": true,
"created_time": "2014-12-06T18:05:03+0000",
"like_count": 0,
"user_likes": false
}
],
"paging": {
"cursors": {
"after": "WTI5dGJXVnVkRjlqZFhKemIzSTZNVFUwTURJMU56Z3dPVFUxTkRjME1qb3hOREUzT0RnNU1UQXpPaTB4",
"before": "WTI5dGJXVnVkRjlqZFhKemIzSTZNVFUwTURJMU56Z3dPVFUxTkRjME1qb3hOREUzT0RnNU1UQXpPaTB4"
}
}
}
the response graph object doesn't match any type of graphObject subclass.
i have tried:
$graphObject['data'][0]['from']['name']
but the graph object is not an array
how can i get the attributes such as name or message from the $graphObject