PHP Класс Google\Cloud\Datastore\EntityMapper

Наследование: use trait Google\Cloud\ArrayTrait, use trait DatastoreTrait
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
__construct ( string $projectId, boolean $encode, boolean $returnInt64AsObject ) Create an Entity Mapper
convertValue ( string $type, mixed $value ) : mixed Convert a Datastore value object to a simple value
objectProperty ( mixed $value ) : array Convert different object types to API values
objectToRequest ( Entity $entity ) : array Translate an Entity to a datastore representation.
responseToEntityProperties ( array $entityData ) : array Convert an entity response to properties, excludes and meanings.
valueObject ( mixed $value, boolean $exclude = false, integer $meaning = null ) : array Format values for the API

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

Метод Описание
convertArrayToArrayValue ( array $value ) : array Convert a non-associative array to a datastore arrayValue type
convertArrayToEntityValue ( array $value ) : array Convert an associative array to a datastore entityValue type
getPropertyValue ( array $property ) : mixed Determine the property type and return a converted value
getValueType ( array $value ) : string Get the value type from a value object.
isEncoded ( $value )

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

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

Create an Entity Mapper
public __construct ( string $projectId, boolean $encode, boolean $returnInt64AsObject )
$projectId string The datastore project ID
$encode boolean Whether to encode blobs as base64.
$returnInt64AsObject boolean If true, 64 bit integers will be returned as a {@see \Google\Cloud\Int64} object for 32 bit platform compatibility.

convertValue() публичный метод

Convert a Datastore value object to a simple value
public convertValue ( string $type, mixed $value ) : mixed
$type string The value type
$value mixed The value
Результат mixed

objectProperty() публичный метод

Convert different object types to API values
public objectProperty ( mixed $value ) : array
$value mixed The value object
Результат array

objectToRequest() публичный метод

Translate an Entity to a datastore representation.
public objectToRequest ( Entity $entity ) : array
$entity Entity The input entity.
Результат array A Datastore [Entity](https://cloud.google.com/datastore/reference/rest/v1/Entity)

responseToEntityProperties() публичный метод

Convert an entity response to properties, excludes and meanings.
public responseToEntityProperties ( array $entityData ) : array
$entityData array The incoming entity
Результат array

valueObject() публичный метод

Format values for the API
public valueObject ( mixed $value, boolean $exclude = false, integer $meaning = null ) : array
$value mixed
$exclude boolean [optional] If true, value will be excluded from datastore indexes.
$meaning integer [optional] The Meaning value. Maintained only for backwards compatibility.
Результат array