PHP Класс GDS\Gateway\RESTv1

https://cloud.google.com/datastore/reference/rest/
Наследование: extends GDS\Gateway
Показать файл Открыть проект

Открытые методы

Метод Описание
__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

Защищенные методы

Метод Описание
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

Приватные методы

Метод Описание
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

Описание методов

__construct() публичный Метод

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() публичный Метод

POST /v1/projects/{projectId}:beginTransaction
public beginTransaction ( boolean $bol_cross_group = FALSE ) : null
$bol_cross_group boolean
Результат null

configureObjectValueParamForQuery() защищенный Метод

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() защищенный Метод

Create a mapper that's right for this Gateway
protected createMapper ( ) : RESTv1
Результат GDS\Mapper\RESTv1

deleteMulti() публичный Метод

Delete 1-many entities
public deleteMulti ( array $arr_entities ) : mixed
$arr_entities array
Результат mixed

extractAutoIDs() защищенный Метод

https://cloud.google.com/datastore/reference/rest/v1/projects/commit#MutationResult
protected extractAutoIDs ( ) : array
Результат array

fetchByKeyPart() защищенный Метод

Consumes Schema
protected fetchByKeyPart ( array $arr_key_parts, $str_setter ) : mixed
$arr_key_parts array
$str_setter
Результат mixed

getEndCursor() публичный Метод

Get the end cursor from the last response
public getEndCursor ( ) : mixed
Результат mixed

getHttpClient() публичный Метод

Get the current HTTP Client in use
public getHttpClient ( ) : GuzzleHttp\ClientInterface
Результат GuzzleHttp\ClientInterface

gql() публичный Метод

POST /v1/projects/{projectId}:runQuery
public gql ( string $str_gql, null | array $arr_params = null ) : mixed
$str_gql string
$arr_params null | array
Результат mixed

httpClient() защищенный Метод

Lazily initialise the HTTP Client when needed. Once.
protected httpClient ( ) : GuzzleHttp\ClientInterface
Результат GuzzleHttp\ClientInterface

initHttpClient() защищенный Метод

Configure HTTP Client
protected initHttpClient ( ) : GuzzleHttp\ClientInterface
Результат GuzzleHttp\ClientInterface

setHttpClient() публичный Метод

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

upsert() защищенный Метод

Put an array of Entities into the Datastore. Return any that need AutoIDs
protected upsert ( array $arr_entities ) : Entity[]
$arr_entities array
Результат GDS\Entity[]