PHP Class GDS\Mapper\RESTv1

Inheritance: extends GDS\Mapper
Datei anzeigen Open project: tomwalder/php-gds

Public Methods

Method Description
buildKeyPath ( Entity $obj_gds_entity, boolean $bol_first_node = true ) : array Create a fully qualified Key path
mapOneFromResult ( object $obj_result ) : Entity Map a single result out of the Raw response data array FROM Google TO a GDS Entity
mapToGoogle ( Entity $obj_gds_entity ) : stdClass Create a REST representation of a GDS entity

Protected Methods

Method Description
createKeyPathElement ( array $arr_kpe ) : stdClass Create a Key Path Element from array
createPropertyValue ( array $arr_field_def, $mix_value ) : mixed Create a property object
extractAutoDetectValue ( object $obj_property ) : mixed Auto detect & extract a value
extractDatetimeValue ( $obj_property ) : mixed Extract a datetime value
extractGeopointValue ( $obj_property ) : Geopoint Extract a Geopoint value
extractPropertyValue ( $int_type, object $obj_property ) : mixed Extract a single property value from a Property object
extractStringListValue ( $obj_property ) : array Extract a String List value

Private Methods

Method Description
bestEffortFieldDefs ( Entity $obj_gds_entity ) : array Find and return the field definitions (if any) for the Entity
createEntityWithKey ( stdClass $obj_result ) : array Create & populate a GDS\Entity with key data

Method Details

buildKeyPath() public method

Create a fully qualified Key path
public buildKeyPath ( Entity $obj_gds_entity, boolean $bol_first_node = true ) : array
$obj_gds_entity GDS\Entity
$bol_first_node boolean
return array

createKeyPathElement() protected method

Create a Key Path Element from array
protected createKeyPathElement ( array $arr_kpe ) : stdClass
$arr_kpe array
return stdClass

createPropertyValue() protected method

Create a property object
protected createPropertyValue ( array $arr_field_def, $mix_value ) : mixed
$arr_field_def array
$mix_value
return mixed

extractAutoDetectValue() protected method

Auto detect & extract a value
protected extractAutoDetectValue ( object $obj_property ) : mixed
$obj_property object
return mixed

extractDatetimeValue() protected method

We will lose accuracy - past seconds in version 3.0 - past microseconds (down from nanoseconds) in version 4.0
protected extractDatetimeValue ( $obj_property ) : mixed
$obj_property
return mixed

extractGeopointValue() protected method

Extract a Geopoint value
protected extractGeopointValue ( $obj_property ) : Geopoint
$obj_property
return GDS\Property\Geopoint

extractPropertyValue() protected method

Defer any varying data type extractions to child classes
protected extractPropertyValue ( $int_type, object $obj_property ) : mixed
$int_type
$obj_property object
return mixed

extractStringListValue() protected method

Extract a String List value
protected extractStringListValue ( $obj_property ) : array
$obj_property
return array

mapOneFromResult() public method

Map a single result out of the Raw response data array FROM Google TO a GDS Entity
public mapOneFromResult ( object $obj_result ) : Entity
$obj_result object
return GDS\Entity

mapToGoogle() public method

https://cloud.google.com/datastore/reference/rest/v1/Entity
public mapToGoogle ( Entity $obj_gds_entity ) : stdClass
$obj_gds_entity GDS\Entity
return stdClass