Cheetah
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Attributes | List of all members
Facebook\GraphNodes\GraphNodeFactory Class Reference
Inheritance diagram for Facebook\GraphNodes\GraphNodeFactory:
Facebook\GraphNodes\GraphObjectFactory

Public Member Functions

 __construct (FacebookResponse $response)
 
 makeGraphNode ($subclassName=null)
 
 makeGraphAchievement ()
 
 makeGraphAlbum ()
 
 makeGraphPage ()
 
 makeGraphSessionInfo ()
 
 makeGraphUser ()
 
 makeGraphEvent ()
 
 makeGraphGroup ()
 
 makeGraphEdge ($subclassName=null, $auto_prefix=true)
 
 validateResponseAsArray ()
 
 validateResponseCastableAsGraphNode ()
 
 validateResponseCastableAsGraphEdge ()
 
 safelyMakeGraphNode (array $data, $subclassName=null)
 
 castAsGraphNodeOrGraphEdge (array $data, $subclassName=null, $parentKey=null, $parentNodeId=null)
 
 safelyMakeGraphEdge (array $data, $subclassName=null, $parentKey=null, $parentNodeId=null)
 
 getMetaData (array $data)
 

Static Public Member Functions

static isCastableAsGraphEdge (array $data)
 
static validateSubclass ($subclassName)
 

Public Attributes

const BASE_GRAPH_NODE_CLASS = '\Facebook\GraphNodes\GraphNode'
 
const BASE_GRAPH_EDGE_CLASS = '\Facebook\GraphNodes\GraphEdge'
 
const BASE_GRAPH_OBJECT_PREFIX = '\Facebook\GraphNodes\\'
 

Protected Attributes

 $response
 
 $decodedBody
 

Detailed Description

Definition at line 43 of file GraphNodeFactory.php.

Constructor & Destructor Documentation

◆ __construct()

Facebook\GraphNodes\GraphNodeFactory::__construct ( FacebookResponse  $response)

Init this Graph object.

Parameters
FacebookResponse$responseThe response entity from Graph.

Definition at line 75 of file GraphNodeFactory.php.

Member Function Documentation

◆ castAsGraphNodeOrGraphEdge()

Facebook\GraphNodes\GraphNodeFactory::castAsGraphNodeOrGraphEdge ( array  $data,
  $subclassName = null,
  $parentKey = null,
  $parentNodeId = null 
)

Takes an array of values and determines how to cast each node.

Parameters
array$dataThe array of data to iterate over.
string | null$subclassNameThe subclass to cast this collection to.
string | null$parentKeyThe key of this data (Graph edge).
string | null$parentNodeIdThe parent Graph node ID.
Returns
GraphNode|GraphEdge
Exceptions
FacebookSDKException

Definition at line 299 of file GraphNodeFactory.php.

◆ getMetaData()

Facebook\GraphNodes\GraphNodeFactory::getMetaData ( array  $data)

Get the meta data from a list in a Graph response.

Parameters
array$dataThe Graph response.
Returns
array

Definition at line 353 of file GraphNodeFactory.php.

◆ isCastableAsGraphEdge()

static Facebook\GraphNodes\GraphNodeFactory::isCastableAsGraphEdge ( array  $data)
static

Determines whether or not the data should be cast as a GraphEdge.

Parameters
array$data
Returns
boolean

Definition at line 367 of file GraphNodeFactory.php.

◆ makeGraphAchievement()

Facebook\GraphNodes\GraphNodeFactory::makeGraphAchievement ( )

Convenience method for creating a GraphAchievement collection.

Returns
GraphAchievement
Exceptions
FacebookSDKException

Definition at line 105 of file GraphNodeFactory.php.

◆ makeGraphAlbum()

Facebook\GraphNodes\GraphNodeFactory::makeGraphAlbum ( )

Convenience method for creating a GraphAlbum collection.

Returns
GraphAlbum
Exceptions
FacebookSDKException

Definition at line 117 of file GraphNodeFactory.php.

◆ makeGraphEdge()

Facebook\GraphNodes\GraphNodeFactory::makeGraphEdge (   $subclassName = null,
  $auto_prefix = true 
)

Tries to convert a FacebookResponse entity into a GraphEdge.

Parameters
string | null$subclassNameThe GraphNode sub class to cast the list items to.
boolean$auto_prefixToggle to auto-prefix the subclass name.
Returns
GraphEdge
Exceptions
FacebookSDKException

Definition at line 192 of file GraphNodeFactory.php.

◆ makeGraphEvent()

Facebook\GraphNodes\GraphNodeFactory::makeGraphEvent ( )

Convenience method for creating a GraphEvent collection.

Returns
GraphEvent
Exceptions
FacebookSDKException

Reimplemented in Facebook\GraphNodes\GraphObjectFactory.

Definition at line 165 of file GraphNodeFactory.php.

◆ makeGraphGroup()

Facebook\GraphNodes\GraphNodeFactory::makeGraphGroup ( )

Convenience method for creating a GraphGroup collection.

Returns
GraphGroup
Exceptions
FacebookSDKException

Definition at line 177 of file GraphNodeFactory.php.

◆ makeGraphNode()

Facebook\GraphNodes\GraphNodeFactory::makeGraphNode (   $subclassName = null)

Tries to convert a FacebookResponse entity into a GraphNode.

Parameters
string | null$subclassNameThe GraphNode sub class to cast to.
Returns
GraphNode
Exceptions
FacebookSDKException

Definition at line 90 of file GraphNodeFactory.php.

◆ makeGraphPage()

Facebook\GraphNodes\GraphNodeFactory::makeGraphPage ( )

Convenience method for creating a GraphPage collection.

Returns
GraphPage
Exceptions
FacebookSDKException

Definition at line 129 of file GraphNodeFactory.php.

◆ makeGraphSessionInfo()

Facebook\GraphNodes\GraphNodeFactory::makeGraphSessionInfo ( )

Convenience method for creating a GraphSessionInfo collection.

Returns
GraphSessionInfo
Exceptions
FacebookSDKException

Definition at line 141 of file GraphNodeFactory.php.

◆ makeGraphUser()

Facebook\GraphNodes\GraphNodeFactory::makeGraphUser ( )

Convenience method for creating a GraphUser collection.

Returns
GraphUser
Exceptions
FacebookSDKException

Definition at line 153 of file GraphNodeFactory.php.

◆ safelyMakeGraphEdge()

Facebook\GraphNodes\GraphNodeFactory::safelyMakeGraphEdge ( array  $data,
  $subclassName = null,
  $parentKey = null,
  $parentNodeId = null 
)

Return an array of GraphNode's.

Parameters
array$dataThe array of data to iterate over.
string | null$subclassNameThe GraphNode subclass to cast each item in the list to.
string | null$parentKeyThe key of this data (Graph edge).
string | null$parentNodeIdThe parent Graph node ID.
Returns
GraphEdge
Exceptions
FacebookSDKException

Definition at line 326 of file GraphNodeFactory.php.

◆ safelyMakeGraphNode()

Facebook\GraphNodes\GraphNodeFactory::safelyMakeGraphNode ( array  $data,
  $subclassName = null 
)

Safely instantiates a GraphNode of $subclassName.

Parameters
array$dataThe array of data to iterate over.
string | null$subclassNameThe subclass to cast this collection to.
Returns
GraphNode
Exceptions
FacebookSDKException

Definition at line 256 of file GraphNodeFactory.php.

◆ validateResponseAsArray()

Facebook\GraphNodes\GraphNodeFactory::validateResponseAsArray ( )

Validates the decoded body.

Exceptions
FacebookSDKException

Definition at line 209 of file GraphNodeFactory.php.

◆ validateResponseCastableAsGraphEdge()

Facebook\GraphNodes\GraphNodeFactory::validateResponseCastableAsGraphEdge ( )

Validates that the return data can be cast as a GraphEdge.

Exceptions
FacebookSDKException

Definition at line 236 of file GraphNodeFactory.php.

◆ validateResponseCastableAsGraphNode()

Facebook\GraphNodes\GraphNodeFactory::validateResponseCastableAsGraphNode ( )

Validates that the return data can be cast as a GraphNode.

Exceptions
FacebookSDKException

Definition at line 221 of file GraphNodeFactory.php.

◆ validateSubclass()

static Facebook\GraphNodes\GraphNodeFactory::validateSubclass (   $subclassName)
static

Ensures that the subclass in question is valid.

Parameters
string$subclassNameThe GraphNode subclass to validate.
Exceptions
FacebookSDKException

Definition at line 384 of file GraphNodeFactory.php.

Member Data Documentation

◆ $decodedBody

Facebook\GraphNodes\GraphNodeFactory::$decodedBody
protected

Definition at line 68 of file GraphNodeFactory.php.

◆ $response

Facebook\GraphNodes\GraphNodeFactory::$response
protected

Definition at line 63 of file GraphNodeFactory.php.

◆ BASE_GRAPH_EDGE_CLASS

const Facebook\GraphNodes\GraphNodeFactory::BASE_GRAPH_EDGE_CLASS = '\Facebook\GraphNodes\GraphEdge'

@const string The base graph edge class.

Definition at line 53 of file GraphNodeFactory.php.

◆ BASE_GRAPH_NODE_CLASS

const Facebook\GraphNodes\GraphNodeFactory::BASE_GRAPH_NODE_CLASS = '\Facebook\GraphNodes\GraphNode'

@const string The base graph object class.

Definition at line 48 of file GraphNodeFactory.php.

◆ BASE_GRAPH_OBJECT_PREFIX

const Facebook\GraphNodes\GraphNodeFactory::BASE_GRAPH_OBJECT_PREFIX = '\Facebook\GraphNodes\\'

@const string The graph object prefix.

Definition at line 58 of file GraphNodeFactory.php.


The documentation for this class was generated from the following file: