From 36f25b4e845b9a53dd6f11402de5bfa61078fdf9 Mon Sep 17 00:00:00 2001 From: emkael Date: Tue, 1 Jan 2019 17:11:00 +0100 Subject: Facebook API updated --- lib/facebook-graph-sdk/src/Facebook/GraphNodes/GraphNode.php | 3 ++- .../src/Facebook/GraphNodes/GraphNodeFactory.php | 4 +++- lib/facebook-graph-sdk/src/Facebook/GraphNodes/GraphPage.php | 10 ++++++++++ 3 files changed, 15 insertions(+), 2 deletions(-) (limited to 'lib/facebook-graph-sdk/src/Facebook/GraphNodes') diff --git a/lib/facebook-graph-sdk/src/Facebook/GraphNodes/GraphNode.php b/lib/facebook-graph-sdk/src/Facebook/GraphNodes/GraphNode.php index 061e744..a81c47b 100644 --- a/lib/facebook-graph-sdk/src/Facebook/GraphNodes/GraphNode.php +++ b/lib/facebook-graph-sdk/src/Facebook/GraphNodes/GraphNode.php @@ -150,7 +150,8 @@ class GraphNode extends Collection 'backdated_time', 'issued_at', 'expires_at', - 'publish_time' + 'publish_time', + 'joined' ], true); } diff --git a/lib/facebook-graph-sdk/src/Facebook/GraphNodes/GraphNodeFactory.php b/lib/facebook-graph-sdk/src/Facebook/GraphNodes/GraphNodeFactory.php index 6a37091..937128b 100644 --- a/lib/facebook-graph-sdk/src/Facebook/GraphNodes/GraphNodeFactory.php +++ b/lib/facebook-graph-sdk/src/Facebook/GraphNodes/GraphNodeFactory.php @@ -304,7 +304,9 @@ class GraphNodeFactory return $this->safelyMakeGraphEdge($data, $subclassName, $parentKey, $parentNodeId); } // Sometimes Graph is a weirdo and returns a GraphNode under the "data" key - $data = $data['data']; + $outerData = $data; + unset($outerData['data']); + $data = $data['data'] + $outerData; } // Create GraphNode diff --git a/lib/facebook-graph-sdk/src/Facebook/GraphNodes/GraphPage.php b/lib/facebook-graph-sdk/src/Facebook/GraphNodes/GraphPage.php index 3dfb0e0..503b96b 100644 --- a/lib/facebook-graph-sdk/src/Facebook/GraphNodes/GraphPage.php +++ b/lib/facebook-graph-sdk/src/Facebook/GraphNodes/GraphPage.php @@ -144,4 +144,14 @@ class GraphPage extends GraphNode { return $this->getField('perms'); } + + /** + * Returns the `fan_count` (Number of people who likes to page) as int if present. + * + * @return int|null + */ + public function getFanCount() + { + return $this->getField('fan_count'); + } } -- cgit v1.2.3