Cheetah
Public Member Functions | Static Public Member Functions | Static Protected Attributes | List of all members
Facebook\GraphNodes\GraphNode Class Reference
Inheritance diagram for Facebook\GraphNodes\GraphNode:
Facebook\GraphNodes\Collection Facebook\GraphNodes\GraphAchievement Facebook\GraphNodes\GraphAlbum Facebook\GraphNodes\GraphApplication Facebook\GraphNodes\GraphCoverPhoto Facebook\GraphNodes\GraphEvent Facebook\GraphNodes\GraphGroup Facebook\GraphNodes\GraphLocation Facebook\GraphNodes\GraphObject Facebook\GraphNodes\GraphPage Facebook\GraphNodes\GraphPicture Facebook\GraphNodes\GraphSessionInfo Facebook\GraphNodes\GraphUser

Public Member Functions

 __construct (array $data=[])
 
 castItems (array $data)
 
 uncastItems ()
 
 asJson ($options=0)
 
 isIso8601DateString ($string)
 
 shouldCastAsDateTime ($key)
 
 castToDateTime ($value)
 
 castToBirthday ($value)
 
- Public Member Functions inherited from Facebook\GraphNodes\Collection
 getField ($name, $default=null)
 
 getProperty ($name, $default=null)
 
 getFieldNames ()
 
 getPropertyNames ()
 
 all ()
 
 asArray ()
 
 map (\Closure $callback)
 
 count ()
 
 getIterator ()
 
 offsetExists ($key)
 
 offsetGet ($key)
 
 offsetSet ($key, $value)
 
 offsetUnset ($key)
 
 __toString ()
 

Static Public Member Functions

static getObjectMap ()
 

Static Protected Attributes

static $graphObjectMap = []
 

Additional Inherited Members

- Protected Attributes inherited from Facebook\GraphNodes\Collection
 $items = []
 

Detailed Description

Definition at line 31 of file GraphNode.php.

Constructor & Destructor Documentation

◆ __construct()

Facebook\GraphNodes\GraphNode::__construct ( array  $data = [])

Init this Graph object.

Parameters
array$data

Reimplemented from Facebook\GraphNodes\Collection.

Definition at line 43 of file GraphNode.php.

Member Function Documentation

◆ asJson()

Facebook\GraphNodes\GraphNode::asJson (   $options = 0)

Get the collection of items as JSON.

Parameters
int$options
Returns
string

Reimplemented from Facebook\GraphNodes\Collection.

Definition at line 104 of file GraphNode.php.

◆ castItems()

Facebook\GraphNodes\GraphNode::castItems ( array  $data)

Iterates over an array and detects the types each node should be cast to and returns all the items as an array.

@TODO Add auto-casting to AccessToken entities.

Parameters
array$dataThe array to iterate over.
Returns
array

Definition at line 58 of file GraphNode.php.

◆ castToBirthday()

Facebook\GraphNodes\GraphNode::castToBirthday (   $value)

Casts a birthday value from Graph to Birthday

Parameters
string$value
Returns
Birthday

Definition at line 183 of file GraphNode.php.

◆ castToDateTime()

Facebook\GraphNodes\GraphNode::castToDateTime (   $value)

Casts a date value from Graph to DateTime.

Parameters
int | string$value
Returns
\DateTime

Definition at line 164 of file GraphNode.php.

◆ getObjectMap()

static Facebook\GraphNodes\GraphNode::getObjectMap ( )
static

Getter for $graphObjectMap.

Returns
array

Definition at line 193 of file GraphNode.php.

◆ isIso8601DateString()

Facebook\GraphNodes\GraphNode::isIso8601DateString (   $string)

Detects an ISO 8601 formatted string.

Parameters
string$string
Returns
boolean
See also
https://developers.facebook.com/docs/graph-api/using-graph-api/#readmodifiers
http://www.cl.cam.ac.uk/~mgk25/iso-time.html
http://en.wikipedia.org/wiki/ISO_8601

Definition at line 120 of file GraphNode.php.

◆ shouldCastAsDateTime()

Facebook\GraphNodes\GraphNode::shouldCastAsDateTime (   $key)

Determines if a value from Graph should be cast to DateTime.

Parameters
string$key
Returns
boolean

Definition at line 143 of file GraphNode.php.

◆ uncastItems()

Facebook\GraphNodes\GraphNode::uncastItems ( )

Uncasts any auto-casted datatypes. Basically the reverse of castItems().

Returns
array

Definition at line 84 of file GraphNode.php.

Member Data Documentation

◆ $graphObjectMap

Facebook\GraphNodes\GraphNode::$graphObjectMap = []
staticprotected

Definition at line 36 of file GraphNode.php.


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