PHP Class GDS\Mapper\ProtoBuf

Author: Tom Walder ([email protected])
Inheritance: extends GDS\Mapper
显示文件 Open project: tomwalder/php-gds

Public Methods

Method Description
configureGoogleKey ( google\appengine\datastore\v4\Key $obj_key, Entity $obj_gds_entity ) : google\appengine\datastore\v4\Key Populate a ProtoBuf Key from a GDS Entity
mapOneFromResult ( google\appengine\datastore\v4\EntityResult $obj_result ) : Entity Map a single result out of the Raw response data into a supplied Entity object
mapToGoogle ( Entity $obj_gds_entity, google\appengine\datastore\v4\Entity $obj_entity ) Map from GDS to Google Protocol Buffer

Protected Methods

Method Description
extractAutoDetectValue ( google\appengine\datastore\v4\Value $obj_property ) : mixed Auto detect & extract a value
extractDatetimeValue ( object $obj_property ) : mixed Extract a datetime value
extractGeopointValue ( google\appengine\datastore\v4\Value $obj_property ) : Geopoint Extract a Geopoint value (lat/lon pair)
extractPropertyValue ( $int_type, object $obj_property ) : array Extract a single property value from a Property object
extractStringListValue ( object $obj_property ) : mixed Extract a String List value

Private Methods

Method Description
configureGoogleKeyPathElement ( google\appengine\datastore\v4\Key\PathElement $obj_path_element, array $arr_kpe ) Configure a Google Key Path Element object
configureGooglePropertyValue ( google\appengine\datastore\v4\Value $obj_val, array $arr_field_def, $mix_value ) Populate a ProtoBuf Property Value from a GDS Entity field definition & value
createEntityWithKey ( google\appengine\datastore\v4\EntityResult $obj_result ) : array Create & populate a GDS\Entity with key data

Method Details

configureGoogleKey() public method

Populate a ProtoBuf Key from a GDS Entity
public configureGoogleKey ( google\appengine\datastore\v4\Key $obj_key, Entity $obj_gds_entity ) : google\appengine\datastore\v4\Key
$obj_key google\appengine\datastore\v4\Key
$obj_gds_entity GDS\Entity
return google\appengine\datastore\v4\Key

extractAutoDetectValue() protected method

Auto detect & extract a value
protected extractAutoDetectValue ( google\appengine\datastore\v4\Value $obj_property ) : mixed
$obj_property google\appengine\datastore\v4\Value
return mixed

extractDatetimeValue() protected method

Extract a datetime value
protected extractDatetimeValue ( object $obj_property ) : mixed
$obj_property object
return mixed

extractGeopointValue() protected method

Extract a Geopoint value (lat/lon pair)
protected extractGeopointValue ( google\appengine\datastore\v4\Value $obj_property ) : Geopoint
$obj_property google\appengine\datastore\v4\Value
return GDS\Property\Geopoint

extractPropertyValue() protected method

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

extractStringListValue() protected method

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

mapOneFromResult() public method

Map a single result out of the Raw response data into a supplied Entity object
public mapOneFromResult ( google\appengine\datastore\v4\EntityResult $obj_result ) : Entity
$obj_result google\appengine\datastore\v4\EntityResult
return GDS\Entity

mapToGoogle() public method

Map from GDS to Google Protocol Buffer
public mapToGoogle ( Entity $obj_gds_entity, google\appengine\datastore\v4\Entity $obj_entity )
$obj_gds_entity GDS\Entity
$obj_entity google\appengine\datastore\v4\Entity