Cheetah
Public Member Functions | Protected Attributes | List of all members
Facebook\GraphNodes\Collection Class Reference
Inheritance diagram for Facebook\GraphNodes\Collection:
Facebook\GraphNodes\GraphEdge Facebook\GraphNodes\GraphNode Facebook\GraphNodes\GraphList 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 $items=[])
 
 getField ($name, $default=null)
 
 getProperty ($name, $default=null)
 
 getFieldNames ()
 
 getPropertyNames ()
 
 all ()
 
 asArray ()
 
 map (\Closure $callback)
 
 asJson ($options=0)
 
 count ()
 
 getIterator ()
 
 offsetExists ($key)
 
 offsetGet ($key)
 
 offsetSet ($key, $value)
 
 offsetUnset ($key)
 
 __toString ()
 

Protected Attributes

 $items = []
 

Detailed Description

Definition at line 39 of file Collection.php.

Constructor & Destructor Documentation

◆ __construct()

Facebook\GraphNodes\Collection::__construct ( array  $items = [])

Create a new collection.

Parameters
array$items

Reimplemented in Facebook\GraphNodes\GraphNode.

Definition at line 53 of file Collection.php.

Member Function Documentation

◆ __toString()

Facebook\GraphNodes\Collection::__toString ( )

Convert the collection to its string representation.

Returns
string

Definition at line 238 of file Collection.php.

◆ all()

Facebook\GraphNodes\Collection::all ( )

Get all of the items in the collection.

Returns
array

Definition at line 119 of file Collection.php.

◆ asArray()

Facebook\GraphNodes\Collection::asArray ( )

Get the collection of items as a plain array.

Returns
array

Definition at line 129 of file Collection.php.

◆ asJson()

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

Get the collection of items as JSON.

Parameters
int$options
Returns
string

Reimplemented in Facebook\GraphNodes\GraphNode.

Definition at line 155 of file Collection.php.

◆ count()

Facebook\GraphNodes\Collection::count ( )

Count the number of items in the collection.

Returns
int

Definition at line 165 of file Collection.php.

◆ getField()

Facebook\GraphNodes\Collection::getField (   $name,
  $default = null 
)

Gets the value of a field from the Graph node.

Parameters
string$nameThe field to retrieve.
mixed$defaultThe default to return if the field doesn't exist.
Returns
mixed

Definition at line 66 of file Collection.php.

◆ getFieldNames()

Facebook\GraphNodes\Collection::getFieldNames ( )

Returns a list of all fields set on the object.

Returns
array

Definition at line 96 of file Collection.php.

◆ getIterator()

Facebook\GraphNodes\Collection::getIterator ( )

Get an iterator for the items.

Returns
ArrayIterator

Definition at line 175 of file Collection.php.

◆ getProperty()

Facebook\GraphNodes\Collection::getProperty (   $name,
  $default = null 
)

Gets the value of the named property for this graph object.

Parameters
string$nameThe property to retrieve.
mixed$defaultThe default to return if the property doesn't exist.
Returns
mixed

Definition at line 86 of file Collection.php.

◆ getPropertyNames()

Facebook\GraphNodes\Collection::getPropertyNames ( )

Returns a list of all properties set on the object.

Returns
array

Definition at line 109 of file Collection.php.

◆ map()

Facebook\GraphNodes\Collection::map ( \Closure  $callback)

Run a map over each of the items.

Parameters
\Closure$callback
Returns
static

Reimplemented in Facebook\GraphNodes\GraphEdge.

Definition at line 143 of file Collection.php.

◆ offsetExists()

Facebook\GraphNodes\Collection::offsetExists (   $key)

Determine if an item exists at an offset.

Parameters
mixed$key
Returns
bool

Definition at line 187 of file Collection.php.

◆ offsetGet()

Facebook\GraphNodes\Collection::offsetGet (   $key)

Get an item at a given offset.

Parameters
mixed$key
Returns
mixed

Definition at line 199 of file Collection.php.

◆ offsetSet()

Facebook\GraphNodes\Collection::offsetSet (   $key,
  $value 
)

Set the item at a given offset.

Parameters
mixed$key
mixed$value
Returns
void

Definition at line 212 of file Collection.php.

◆ offsetUnset()

Facebook\GraphNodes\Collection::offsetUnset (   $key)

Unset the item at a given offset.

Parameters
string$key
Returns
void

Definition at line 228 of file Collection.php.

Member Data Documentation

◆ $items

Facebook\GraphNodes\Collection::$items = []
protected

Definition at line 46 of file Collection.php.


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