class Collection extends Model implements Iterator, Countable (View source)

Extension to the regular Google\Model that automatically exposes the items array for iteration, so you can just iterate over the object rather than a reference inside.

Constants

NULL_VALUE

If you need to specify a NULL JSON value, use Google\Model::NULL_VALUE instead - it will be replaced when converting to JSON with a real null.

Properties

protected $internal_gapi_mappings from  Model
protected $modelData from  Model
protected $processed from  Model
protected $collection_key

Methods

__construct()

Polymorphic - accepts a variable number of arguments dependent on the type of the model subclass.

from  Model
mixed
__get(string $key)

Getter that handles passthrough access to the data array, and lazy object creation.

from  Model
void
mapTypes(array $array)

Initialize this object's properties from an array.

from  Model
gapiInit()

Blank initialiser to be used in subclasses to do post-construction initialisation - this avoids the need for subclasses to have to implement the variadics handling in their constructors.

from  Model
toSimpleObject()

Create a simplified object suitable for straightforward conversion to JSON. This is relatively expensive due to the usage of reflection, but shouldn't be called a whole lot, and is the most straightforward way to filter.

from  Model
bool
isAssociativeArray(array $array)

Returns true only if the array is associative.

from  Model
assertIsArray(array $obj, string $method)

Verify if $obj is an array.

from  Model
bool
offsetExists($offset)

No description

mixed
offsetGet($offset)

No description

void
offsetSet($offset, $value)

No description

void
offsetUnset($offset)

No description

keyType($key)

No description

from  Model
dataType($key)

No description

from  Model
__isset($key)

No description

from  Model
__unset($key)

No description

from  Model
void
rewind()

No description

mixed
current()

No description

mixed
key()

No description

mixed
next()

No description

bool
valid()

No description

int
count()

No description

Details

final __construct()

Polymorphic - accepts a variable number of arguments dependent on the type of the model subclass.

mixed __get(string $key)

Getter that handles passthrough access to the data array, and lazy object creation.

Parameters

string $key

Property name.

Return Value

mixed

The value if any, or null.

protected void mapTypes(array $array)

Initialize this object's properties from an array.

Parameters

array $array

Used to seed this object's properties.

Return Value

void

protected gapiInit()

Blank initialiser to be used in subclasses to do post-construction initialisation - this avoids the need for subclasses to have to implement the variadics handling in their constructors.

toSimpleObject()

Create a simplified object suitable for straightforward conversion to JSON. This is relatively expensive due to the usage of reflection, but shouldn't be called a whole lot, and is the most straightforward way to filter.

protected bool isAssociativeArray(array $array)

Returns true only if the array is associative.

Parameters

array $array

Return Value

bool

True if the array is associative.

assertIsArray(array $obj, string $method)

Verify if $obj is an array.

Parameters

array $obj

Items that should be validated.

string $method

Method expecting an array as an argument.

Exceptions

Exception

bool offsetExists($offset)

No description

Parameters

$offset

Return Value

bool

mixed offsetGet($offset)

No description

Parameters

$offset

Return Value

mixed

void offsetSet($offset, $value)

No description

Parameters

$offset
$value

Return Value

void

void offsetUnset($offset)

No description

Parameters

$offset

Return Value

void

protected keyType($key)

No description

Parameters

$key

protected dataType($key)

No description

Parameters

$key

__isset($key)

No description

Parameters

$key

__unset($key)

No description

Parameters

$key

void rewind()

No description

Return Value

void

mixed current()

No description

Return Value

mixed

mixed key()

No description

Return Value

mixed

mixed next()

No description

Return Value

mixed

bool valid()

No description

Return Value

bool

int count()

No description

Return Value

int