Skip to content

Commit 5127546

Browse files
committed
Merge pull request facebookarchive#497 from guidolodetti/docs-facebookresponse-improvement
Improved the getGraphEdge() function documentation
2 parents 4977ce7 + 3aa9fe8 commit 5127546

File tree

2 files changed

+21
-5
lines changed

2 files changed

+21
-5
lines changed

docs/FacebookResponse.fbmd

+17-1
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,23 @@ Returns the response data in the form of a [`Facebook\GraphNodes\GraphUser`](/do
181181
<card>
182182
### getGraphEdge() {#get-graph-edge}
183183
~~~~
184-
public Facebook\GraphNodes\GraphEdge getGraphEdge()
184+
public Facebook\GraphNodes\GraphEdge getGraphEdge(
185+
string|null $subclassName,
186+
boolean $auto_prefix)
185187
~~~~
186188
Returns the response data in the form of a [`Facebook\GraphNodes\GraphEdge`](/docs/php/GraphEdge) collection.
189+
190+
`$subclassName`
191+
The `Facebook\GraphNodes\GraphNode` subclass to cast list items to. If none is provided, default is `Facebook\GraphNodes\GraphNode`.
192+
193+
`$auto_prefix`
194+
Toggle to auto-prefix the subclass name. If none is provided, default is `true`.
195+
196+
~~~~
197+
$res = $fb->get('/{facebook-page}/events', '{access-token}');
198+
$events = $res->getGraphEdge("GraphEvent");
199+
foreach ($events as $event) {
200+
// . . .
201+
}
202+
~~~~
187203
</card>

src/Facebook/FacebookResponse.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ public function decodeBody()
259259
/**
260260
* Instantiate a new GraphObject from response.
261261
*
262-
* @param string|null $subclassName The GraphNode sub class to cast to.
262+
* @param string|null $subclassName The GraphNode subclass to cast to.
263263
*
264264
* @return \Facebook\GraphNodes\GraphObject
265265
*
@@ -276,7 +276,7 @@ public function getGraphObject($subclassName = null)
276276
/**
277277
* Instantiate a new GraphNode from response.
278278
*
279-
* @param string|null $subclassName The GraphNode sub class to cast to.
279+
* @param string|null $subclassName The GraphNode subclass to cast to.
280280
*
281281
* @return \Facebook\GraphNodes\GraphNode
282282
*
@@ -376,7 +376,7 @@ public function getGraphGroup()
376376
/**
377377
* Instantiate a new GraphList from response.
378378
*
379-
* @param string|null $subclassName The GraphNode sub class to cast list items to.
379+
* @param string|null $subclassName The GraphNode subclass to cast list items to.
380380
* @param boolean $auto_prefix Toggle to auto-prefix the subclass name.
381381
*
382382
* @return \Facebook\GraphNodes\GraphList
@@ -394,7 +394,7 @@ public function getGraphList($subclassName = null, $auto_prefix = true)
394394
/**
395395
* Instantiate a new GraphEdge from response.
396396
*
397-
* @param string|null $subclassName The GraphNode sub class to cast list items to.
397+
* @param string|null $subclassName The GraphNode subclass to cast list items to.
398398
* @param boolean $auto_prefix Toggle to auto-prefix the subclass name.
399399
*
400400
* @return \Facebook\GraphNodes\GraphEdge

0 commit comments

Comments
 (0)