Constants

NULL_VALUE

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

$internal_gapi_mappings

$internal_gapi_mappings : 

Type

$modelData

$modelData : 

Type

$processed

$processed : 

Type

Methods

__construct()

__construct() 

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

__get()

__get(string  $key) : mixed

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

Parameters

string $key

Property name.

Returns

mixed —

The value if any, or null.

toSimpleObject()

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.

assertIsArray()

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.

Throws

\Google_Exception

Thrown if $obj isn't an array.

offsetExists()

offsetExists(  $offset) 

Parameters

$offset

offsetGet()

offsetGet(  $offset) 

Parameters

$offset

offsetSet()

offsetSet(  $offset,   $value) 

Parameters

$offset
$value

offsetUnset()

offsetUnset(  $offset) 

Parameters

$offset

__isset()

__isset(  $key) 

Parameters

$key

__unset()

__unset(  $key) 

Parameters

$key

mapTypes()

mapTypes(array  $array) : void

Initialize this object's properties from an array.

Parameters

array $array

Used to seed this object's properties.

gapiInit()

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.

isAssociativeArray()

isAssociativeArray(array  $array) : boolean

Returns true only if the array is associative.

Parameters

array $array

Returns

boolean —

True if the array is associative.

keyType()

keyType(  $key) 

Parameters

$key

dataType()

dataType(  $key) 

Parameters

$key

getSimpleValue()

getSimpleValue(  $value) 

Handle different types of values, primarily other objects and map and array data types.

Parameters

$value

nullPlaceholderCheck()

nullPlaceholderCheck(  $value) 

Check whether the value is the null placeholder and return true null.

Parameters

$value

getMappedName()

getMappedName(  $key) 

If there is an internal name mapping, use that.

Parameters

$key

createObjectFromName()

createObjectFromName(  $name,   $item) : object

Given a variable name, discover its type.

Parameters

$name
$item

Returns

object —

The object from the item.

camelCase()

camelCase(string  $value) : string

Convert a string to camelCase

Parameters

string $value

Returns

string