PHP Class GDS\Gateway\RESTv1

https://cloud.google.com/datastore/reference/rest/
Inheritance: extends GDS\Gateway
Afficher le fichier Open project: tomwalder/php-gds

Méthodes publiques

Méthode Description
__construct ( $str_project_id, null $str_namespace = null ) Create the auth middleware and set up the HTTP Client
beginTransaction ( boolean $bol_cross_group = FALSE ) : null Start a transaction
deleteMulti ( array $arr_entities ) : mixed Delete 1-many entities
getEndCursor ( ) : mixed Get the end cursor from the last response
getHttpClient ( ) : GuzzleHttp\ClientInterface Get the current HTTP Client in use
gql ( string $str_gql, null | array $arr_params = null ) : mixed Fetch some Entities, based on the supplied GQL and, optionally, parameters
setHttpClient ( GuzzleHttp\ClientInterface $obj_client ) Use a pre-configured HTTP Client

Méthodes protégées

Méthode Description
configureObjectValueParamForQuery ( object $obj_val, object $mix_value ) Configure a Value parameter, based on the supplied object-type value
createMapper ( ) : RESTv1 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 ) : mixed Fetch 1-many Entities, using the Key parts provided
httpClient ( ) : GuzzleHttp\ClientInterface Lazily initialise the HTTP Client when needed. Once.
initHttpClient ( ) : GuzzleHttp\ClientInterface Configure HTTP Client
upsert ( array $arr_entities ) : Entity[] Put an array of Entities into the Datastore. Return any that need AutoIDs

Private Methods

Méthode Description
actionUrl ( $str_action ) : string Build a URL for a Datastore action
addParamsToQuery ( stdClass $obj_query, array $arr_params ) Add Parameters to a GQL Query object
applyPartition ( stdClass $obj_request ) : stdClass Apply project and namespace to a query
applyTransaction ( stdClass $obj_request ) : mixed If we are in a transaction, apply it to the request object
buildCommitRequest ( ) : object Build a basic commit request (used by upsert, delete)
buildQueryParamValue ( $mix_value ) : stdClass Build a JSON representation of a value
executePostRequest ( $str_action, null $obj_request_body = null ) Execute a POST request against the API

Method Details

__construct() public méthode

Create the auth middleware and set up the HTTP Client
public __construct ( $str_project_id, null $str_namespace = null )
$str_project_id
$str_namespace null

beginTransaction() public méthode

POST /v1/projects/{projectId}:beginTransaction
public beginTransaction ( boolean $bol_cross_group = FALSE ) : null
$bol_cross_group boolean
Résultat null

configureObjectValueParamForQuery() protected méthode

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

createMapper() protected méthode

Create a mapper that's right for this Gateway
protected createMapper ( ) : RESTv1
Résultat GDS\Mapper\RESTv1

deleteMulti() public méthode

Delete 1-many entities
public deleteMulti ( array $arr_entities ) : mixed
$arr_entities array
Résultat mixed

extractAutoIDs() protected méthode

https://cloud.google.com/datastore/reference/rest/v1/projects/commit#MutationResult
protected extractAutoIDs ( ) : array
Résultat array

fetchByKeyPart() protected méthode

Consumes Schema
protected fetchByKeyPart ( array $arr_key_parts, $str_setter ) : mixed
$arr_key_parts array
$str_setter
Résultat mixed

getEndCursor() public méthode

Get the end cursor from the last response
public getEndCursor ( ) : mixed
Résultat mixed

getHttpClient() public méthode

Get the current HTTP Client in use
public getHttpClient ( ) : GuzzleHttp\ClientInterface
Résultat GuzzleHttp\ClientInterface

gql() public méthode

POST /v1/projects/{projectId}:runQuery
public gql ( string $str_gql, null | array $arr_params = null ) : mixed
$str_gql string
$arr_params null | array
Résultat mixed

httpClient() protected méthode

Lazily initialise the HTTP Client when needed. Once.
protected httpClient ( ) : GuzzleHttp\ClientInterface
Résultat GuzzleHttp\ClientInterface

initHttpClient() protected méthode

Configure HTTP Client
protected initHttpClient ( ) : GuzzleHttp\ClientInterface
Résultat GuzzleHttp\ClientInterface

setHttpClient() public méthode

Use a pre-configured HTTP Client
public setHttpClient ( GuzzleHttp\ClientInterface $obj_client )
$obj_client GuzzleHttp\ClientInterface

upsert() protected méthode

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