ValueMapper
in package
Uses
ArrayTrait
Maps values to their expected BigQuery types. This class is intended for internal use only.
Table of Contents
Constants
- DATETIME_FORMAT = 'Y-m-d H:i:s.u'
- DATETIME_FORMAT_INSERT = 'Y-m-d\\TH:i:s.u'
- TYPE_ARRAY = 'ARRAY'
- TYPE_BIGNUMERIC = 'BIGNUMERIC'
- TYPE_BOOL = 'BOOL'
- TYPE_BOOLEAN = 'BOOLEAN'
- TYPE_BYTES = 'BYTES'
- TYPE_DATE = 'DATE'
- TYPE_DATETIME = 'DATETIME'
- TYPE_FLOAT = 'FLOAT'
- TYPE_FLOAT64 = 'FLOAT64'
- TYPE_GEOGRAPHY = 'GEOGRAPHY'
- TYPE_INT64 = 'INT64'
- TYPE_INTEGER = 'INTEGER'
- TYPE_JSON = 'JSON'
- TYPE_NUMERIC = 'NUMERIC'
- TYPE_RECORD = 'RECORD'
- TYPE_STRING = 'STRING'
- TYPE_STRUCT = 'STRUCT'
- TYPE_TIME = 'TIME'
- TYPE_TIMESTAMP = 'TIMESTAMP'
Properties
- $returnInt64AsObject : bool
Methods
- __construct() : mixed
- fromBigQuery() : mixed
- Maps a value coming from BigQuery to the expected format for use in the library.
- toBigQuery() : mixed
- Maps a user provided value to the expected BigQuery format.
- toParameter() : array<string|int, mixed>
- Maps a value to the expected parameter format.
- arrayToParameter() : array<string|int, mixed>
- assocArrayToParameter() : array<string|int, mixed>
- objectToParameter() : array<string|int, mixed>
- recordFromBigQuery() : array<string|int, mixed>
- repeatedValueFromBigQuery() : array<string|int, mixed>
- timestampFromBigQuery() : Timestamp
- Converts a timestamp in string format received from BigQuery to a {@see Timestamp}.
Constants
DATETIME_FORMAT
public
mixed
DATETIME_FORMAT
= 'Y-m-d H:i:s.u'
DATETIME_FORMAT_INSERT
public
mixed
DATETIME_FORMAT_INSERT
= 'Y-m-d\\TH:i:s.u'
TYPE_ARRAY
public
mixed
TYPE_ARRAY
= 'ARRAY'
TYPE_BIGNUMERIC
public
mixed
TYPE_BIGNUMERIC
= 'BIGNUMERIC'
TYPE_BOOL
public
mixed
TYPE_BOOL
= 'BOOL'
TYPE_BOOLEAN
public
mixed
TYPE_BOOLEAN
= 'BOOLEAN'
TYPE_BYTES
public
mixed
TYPE_BYTES
= 'BYTES'
TYPE_DATE
public
mixed
TYPE_DATE
= 'DATE'
TYPE_DATETIME
public
mixed
TYPE_DATETIME
= 'DATETIME'
TYPE_FLOAT
public
mixed
TYPE_FLOAT
= 'FLOAT'
TYPE_FLOAT64
public
mixed
TYPE_FLOAT64
= 'FLOAT64'
TYPE_GEOGRAPHY
public
mixed
TYPE_GEOGRAPHY
= 'GEOGRAPHY'
TYPE_INT64
public
mixed
TYPE_INT64
= 'INT64'
TYPE_INTEGER
public
mixed
TYPE_INTEGER
= 'INTEGER'
TYPE_JSON
public
mixed
TYPE_JSON
= 'JSON'
TYPE_NUMERIC
public
mixed
TYPE_NUMERIC
= 'NUMERIC'
TYPE_RECORD
public
mixed
TYPE_RECORD
= 'RECORD'
TYPE_STRING
public
mixed
TYPE_STRING
= 'STRING'
TYPE_STRUCT
public
mixed
TYPE_STRUCT
= 'STRUCT'
TYPE_TIME
public
mixed
TYPE_TIME
= 'TIME'
TYPE_TIMESTAMP
public
mixed
TYPE_TIMESTAMP
= 'TIMESTAMP'
Properties
$returnInt64AsObject
private
bool
$returnInt64AsObject
If true, 64 bit integers will be returned as a Int64 object for 32 bit platform compatibility.
Methods
__construct()
public
__construct(bool $returnInt64AsObject) : mixed
Parameters
- $returnInt64AsObject : bool
-
If true, 64 bit integers will be returned as a Int64 object for 32 bit platform compatibility.
fromBigQuery()
Maps a value coming from BigQuery to the expected format for use in the library.
public
fromBigQuery(array<string|int, mixed> $value, array<string|int, mixed> $schema) : mixed
Parameters
- $value : array<string|int, mixed>
-
The value to map.
- $schema : array<string|int, mixed>
-
The schema describing the value.
Tags
toBigQuery()
Maps a user provided value to the expected BigQuery format.
public
toBigQuery(mixed $value) : mixed
Parameters
- $value : mixed
-
The value to map.
toParameter()
Maps a value to the expected parameter format.
public
toParameter(mixed $value) : array<string|int, mixed>
Parameters
- $value : mixed
-
The value to map.
Tags
Return values
array<string|int, mixed>arrayToParameter()
private
arrayToParameter(array<string|int, mixed> $array) : array<string|int, mixed>
Parameters
- $array : array<string|int, mixed>
-
The array to map.
Return values
array<string|int, mixed>assocArrayToParameter()
private
assocArrayToParameter(array<string|int, mixed> $struct) : array<string|int, mixed>
Parameters
- $struct : array<string|int, mixed>
-
The struct to map.
Return values
array<string|int, mixed>objectToParameter()
private
objectToParameter(mixed $object) : array<string|int, mixed>
Parameters
- $object : mixed
-
The object to map.
Tags
Return values
array<string|int, mixed>recordFromBigQuery()
private
recordFromBigQuery(array<string|int, mixed> $value, array<string|int, mixed> $schema) : array<string|int, mixed>
Parameters
- $value : array<string|int, mixed>
-
The value to map.
- $schema : array<string|int, mixed>
-
The schema describing the value.
Return values
array<string|int, mixed>repeatedValueFromBigQuery()
private
repeatedValueFromBigQuery(array<string|int, mixed> $value, array<string|int, mixed> $schema) : array<string|int, mixed>
Parameters
- $value : array<string|int, mixed>
-
The value to map.
- $schema : array<string|int, mixed>
-
The schema describing the value.
Return values
array<string|int, mixed>timestampFromBigQuery()
Converts a timestamp in string format received from BigQuery to a {@see Timestamp}.
private
timestampFromBigQuery(string $value) : Timestamp
Parameters
- $value : string
-
The timestamp.