PHP Class GDS\Gateway\ProtoBuf

Author: Tom Walder ([email protected])
Inheritance: extends GDS\Gateway
Datei anzeigen Open project: tomwalder/php-gds

Public Methods

Method Description
__construct ( null | string $str_dataset = null, null | string $str_namespace = null ) Set up the dataset and optional namespace
beginTransaction ( boolean $bol_cross_group = FALSE ) : string | null Begin a transaction
deleteMulti ( array $arr_entities ) : boolean Delete 1 or many entities, using their Keys
getEndCursor ( ) Get the end cursor from the last response
gql ( string $str_gql, array | null $arr_params = null ) : Entity[] | null Fetch some Entities, based on the supplied GQL and, optionally, parameters
upsert ( array $arr_entities ) : Entity[] Put an array of Entities into the Datastore. Return any that need AutoIDs

Protected Methods

Method Description
configureObjectValueParamForQuery ( google\appengine\datastore\v4\Value $obj_val, object $mix_value ) Configure a Value parameter, based on the supplied object-type value
createMapper ( ) : ProtoBuf Create a mapper that's right for this Gateway
extractAutoIDs ( ) : array Extract Auto Insert IDs from the last response
fetchByKeyPart ( array $arr_key_parts, $str_setter ) : Entity[] | null Fetch 1-many Entities, using the Key parts provided

Private Methods

Method Description
addParamsToQuery ( google\appengine\datastore\v4\GqlQuery $obj_query, array $arr_params ) Add Parameters to a GQL Query object
applyNamespace ( object $obj_target ) : mixed Apply dataset and namespace ("partition") to an object
applyTransaction ( $obj ) : mixed Apply a transaction to an object
configureFilterFromGql ( google\appengine\datastore\v4\PropertyFilter $obj_filter, $arr_filter )
execute ( $str_method, google\net\ProtocolMessage $obj_request, google\net\ProtocolMessage $obj_response ) : mixed Execute a method against the Datastore
executeGqlAsBasicQuery ( google\net\ProtocolMessage $obj_gql_request ) : null Take a GQL RunQuery request and convert to a standard RunQuery request
setupCommit ( ) : google\appengine\datastore\v4\CommitRequest Set up a commit request
setupLookup ( ) : google\appengine\datastore\v4\LookupRequest Set up a LookupRequest
setupRunQuery ( ) : google\appengine\datastore\v4\RunQueryRequest Set up a RunQueryRequest

Method Details

__construct() public method

Set up the dataset and optional namespace
public __construct ( null | string $str_dataset = null, null | string $str_namespace = null )
$str_dataset null | string
$str_namespace null | string

beginTransaction() public method

Begin a transaction
public beginTransaction ( boolean $bol_cross_group = FALSE ) : string | null
$bol_cross_group boolean
return string | null

configureObjectValueParamForQuery() protected method

Configure a Value parameter, based on the supplied object-type value
protected configureObjectValueParamForQuery ( google\appengine\datastore\v4\Value $obj_val, object $mix_value )
$obj_val google\appengine\datastore\v4\Value
$mix_value object

createMapper() protected method

Create a mapper that's right for this Gateway
protected createMapper ( ) : ProtoBuf
return GDS\Mapper\ProtoBuf

deleteMulti() public method

Consumes Schema
public deleteMulti ( array $arr_entities ) : boolean
$arr_entities array
return boolean

extractAutoIDs() protected method

Extract Auto Insert IDs from the last response
protected extractAutoIDs ( ) : array
return array

fetchByKeyPart() protected method

Fetch 1-many Entities, using the Key parts provided
protected fetchByKeyPart ( array $arr_key_parts, $str_setter ) : Entity[] | null
$arr_key_parts array
$str_setter
return GDS\Entity[] | null

getEndCursor() public method

Get the end cursor from the last response
public getEndCursor ( )

gql() public method

In local dev environments, we may convert the GQL query later.
public gql ( string $str_gql, array | null $arr_params = null ) : Entity[] | null
$str_gql string
$arr_params array | null
return GDS\Entity[] | null

upsert() public method

Put an array of Entities into the Datastore. Return any that need AutoIDs
public upsert ( array $arr_entities ) : Entity[]
$arr_entities array
return GDS\Entity[]