PHP Client for Apache Ignite
|
Public Member Functions | |
getTypeCode () | |
Public Attributes | |
PrimitiveTypeCodes | |
const | BYTE = 1 |
const | SHORT = 2 |
const | INTEGER = 3 |
const | LONG = 4 |
const | FLOAT = 5 |
const | DOUBLE = 6 |
const | CHAR = 7 |
const | BOOLEAN = 8 |
const | STRING = 9 |
const | UUID = 10 |
const | DATE = 11 |
const | BYTE_ARRAY = 12 |
const | SHORT_ARRAY = 13 |
const | INTEGER_ARRAY = 14 |
const | LONG_ARRAY = 15 |
const | FLOAT_ARRAY = 16 |
const | DOUBLE_ARRAY = 17 |
const | CHAR_ARRAY = 18 |
const | BOOLEAN_ARRAY = 19 |
const | STRING_ARRAY = 20 |
const | UUID_ARRAY = 21 |
const | DATE_ARRAY = 22 |
const | ENUM = 28 |
const | ENUM_ARRAY = 29 |
const | DECIMAL = 30 |
const | DECIMAL_ARRAY = 31 |
const | TIMESTAMP = 33 |
const | TIMESTAMP_ARRAY = 34 |
const | TIME = 36 |
const | TIME_ARRAY = 37 |
CompositeTypeCodes | |
const | OBJECT_ARRAY = 23 |
const | COLLECTION = 24 |
const | MAP = 25 |
const | BINARY_OBJECT = 27 |
const | BINARY_ENUM = 38 |
const | NULL = 101 |
const | COMPLEX_OBJECT = 103 |
Base class representing a type of Ignite object.
The class is abstract and has no public constructor. Only subclasses may be instantiated.
There are two groups of Ignite object types:
This class helps the Ignite client to make a mapping between PHP types and types used by Ignite according to the following mapping tables:
It is a PHP primitive or a PHP object: http://php.net/manual/en/language.types.intro.php
Associative and indexed PHP arrays: http://php.net/manual/en/language.types.array.php
Additional types:
It is a type code of Ignite primitive type (PrimitiveTypeCodes) or Ignite composite type (CompositeTypeCodes).
Ignite type code | PHP type |
---|---|
BYTE | integer |
SHORT | integer |
INTEGER | integer |
LONG | float |
FLOAT | float |
DOUBLE | float |
DECIMAL | Brick\Math\BigDecimal |
BOOLEAN | boolean |
STRING | string |
CHAR | string (one character) |
UUID | indexed array of integers (16 items) |
DATE | Date |
TIME | Time |
TIMESTAMP | Timestamp |
ENUM | EnumItem |
COMPLEX_OBJECT | BinaryObject or PHP object* |
BYTE_ARRAY | indexed array of integer |
SHORT_ARRAY | indexed array of integer |
INTEGER_ARRAY | indexed array of integer |
LONG_ARRAY | indexed array of float |
FLOAT_ARRAY | indexed array of float |
DOUBLE_ARRAY | indexed array of float |
DECIMAL_ARRAY | indexed array of Brick\Math\BigDecimal |
BOOLEAN_ARRAY | indexed array of boolean |
STRING_ARRAY | indexed array of string |
CHAR_ARRAY | indexed array of string (one character) |
UUID_ARRAY | indexed array of array of integers (16 items) |
DATE_ARRAY | indexed array of Date |
TIME_ARRAY | indexed array of Time |
TIMESTAMP_ARRAY | indexed array of Timestamp |
ENUM_ARRAY | indexed array of EnumItem |
OBJECT_ARRAY | indexed array |
COLLECTION (USER_COL) | indexed array |
COLLECTION (ARR_LIST) | indexed array |
COLLECTION (LINKED_LIST) | indexed array |
COLLECTION (SINGLETON_LIST) | indexed array |
COLLECTION (HASH_SET) | Ds\Set |
COLLECTION (LINKED_HASH_SET) | Ds\Set |
COLLECTION (USER_SET) | Ds\Set |
MAP (HASH_MAP) | Ds\Map |
MAP (LINKED_HASH_MAP) | Ds\Map |
NULL | null** |
(*) If an application does not explicitly specify an Ignite type for a field and COMPLEX_OBJECT is received, the Ignite client returns BinaryObject to the application. If an application explicitly specifies ComplexObjectType for a field, the Ignite client deserializes the received COMPLEX_OBJECT into PHP object specified by the ComplexObjectType.
(**) NULL cannot be specified as an Ignite type of a field but PHP null may be returned as a value of a field.
This mapping is used when an application does not explicitly specify an Ignite type for a field and it is writing data to that field.
PHP type | Ignite type code |
---|---|
boolean | BOOLEAN |
integer | INTEGER |
float | DOUBLE |
string | STRING |
Date | DATE |
Time | TIME |
Timestamp | TIMESTAMP |
EnumItem | ENUM |
Brick\Math\BigDecimal | DECIMAL |
BinaryObject | COMPLEX_OBJECT |
any other PHP Object* | COMPLEX_OBJECT |
associative array of PHP supported type** | MAP (HASH_MAP) |
indexed array of boolean*** | BOOLEAN_ARRAY |
indexed array of integer | INTEGER_ARRAY |
indexed array of float | DOUBLE_ARRAY |
indexed array of string | STRING_ARRAY |
indexed array of Date | DATE_ARRAY |
indexed array of Time | TIME_ARRAY |
indexed array of Timestamp | TIMESTAMP_ARRAY |
indexed array of EnumItem | ENUM_ARRAY |
indexed array of Brick\Math\BigDecimal | DECIMAL_ARRAY |
indexed array of BinaryObject | OBJECT_ARRAY |
indexed array of any other PHP Object* | OBJECT_ARRAY |
Ds\Set | COLLECTION (HASH_SET) |
Ds\Map | MAP (HASH_MAP) |
All other PHP types have no default mapping to Ignite type codes.
(*) Any other PHP Object - is any PHP class, not explicitly mentioned in the table.
(**) PHP supported type - is any PHP type mentioned in the table.
(***) Type of an indexed array's value is determined by the value's type in the first element of the array. Empty array has no default mapping.
When an application explicitly specifies an Ignite type for a field and it is writing data to that field, the following PHP types are allowed for every concrete Ignite type code.
Specified Ignite type code | Allowed PHP types |
---|---|
BYTE | integer |
SHORT | integer |
INTEGER | integer |
LONG | float, integer |
FLOAT | float, integer |
DOUBLE | float, integer |
DECIMAL | Brick\Math\BigDecimal |
BOOLEAN | boolean |
STRING | string |
CHAR | string (one character) |
UUID | indexed array of integers (16 items) |
DATE | Date |
TIME | Time |
TIMESTAMP | Timestamp |
ENUM | EnumItem |
COMPLEX_OBJECT | BinaryObject, any PHP object |
BYTE_ARRAY* | indexed array of integer |
SHORT_ARRAY | indexed array of integer |
INTEGER_ARRAY | indexed array of integer |
LONG_ARRAY | indexed array of float/integer |
FLOAT_ARRAY | indexed array of float/integer |
DOUBLE_ARRAY | indexed array of float/integer |
DECIMAL_ARRAY | indexed array of Brick\Math\BigDecimal |
BOOLEAN_ARRAY | indexed array of boolean |
STRING_ARRAY | indexed array of string |
CHAR_ARRAY | indexed array of string (one character) |
UUID_ARRAY | indexed array of array of integers (16 items) |
DATE_ARRAY | indexed array of Date |
TIME_ARRAY | indexed array of Time |
TIMESTAMP_ARRAY | indexed array of Timestamp |
ENUM_ARRAY | indexed array of EnumItem |
OBJECT_ARRAY | indexed array |
COLLECTION (USER_COL) | indexed array |
COLLECTION (ARR_LIST) | indexed array |
COLLECTION (LINKED_LIST) | indexed array |
COLLECTION (SINGLETON_LIST) | indexed array |
COLLECTION (HASH_SET) | Ds\Set |
COLLECTION (LINKED_HASH_SET) | Ds\Set |
COLLECTION (USER_SET) | Ds\Set |
MAP (HASH_MAP) | Ds\Map, associative array |
MAP (LINKED_HASH_MAP) | Ds\Map, associative array |
(*) For all *_ARRAY Ignite types an empty PHP indexed array is allowed.
PHP null is allowed as value of a field (but not as a key/value in a cache) or as a value of Array/Set/Map element for all Ignite types, except BYTE, SHORT, INTEGER, LONG, FLOAT, DOUBLE, CHAR, BOOLEAN.
Apache\Ignite\Type\ObjectType::getTypeCode | ( | ) |
Gets Ignite type code of this Ignite object type.
const Apache\Ignite\Type\ObjectType::BINARY_ENUM = 38 |
Wrapped enumerable type.
const Apache\Ignite\Type\ObjectType::BINARY_OBJECT = 27 |
Wrapped binary object type.
const Apache\Ignite\Type\ObjectType::BOOLEAN = 8 |
Boolean value.
const Apache\Ignite\Type\ObjectType::BOOLEAN_ARRAY = 19 |
Array of boolean values.
const Apache\Ignite\Type\ObjectType::BYTE = 1 |
Single byte value. Can also represent small signed integer value.
const Apache\Ignite\Type\ObjectType::BYTE_ARRAY = 12 |
Array of bytes.
const Apache\Ignite\Type\ObjectType::CHAR = 7 |
Single UTF-16 code unit.
const Apache\Ignite\Type\ObjectType::CHAR_ARRAY = 18 |
Array of UTF-16 code units.
const Apache\Ignite\Type\ObjectType::COLLECTION = 24 |
General collection type.
const Apache\Ignite\Type\ObjectType::COMPLEX_OBJECT = 103 |
Complex object.
const Apache\Ignite\Type\ObjectType::DATE = 11 |
Date, represented as a number of milliseconds elapsed since 00:00:00 1 Jan 1970 UTC.
const Apache\Ignite\Type\ObjectType::DATE_ARRAY = 22 |
Array of dates.
const Apache\Ignite\Type\ObjectType::DECIMAL = 30 |
Numeric value of any desired precision and scale.
const Apache\Ignite\Type\ObjectType::DECIMAL_ARRAY = 31 |
Array of decimal values.
const Apache\Ignite\Type\ObjectType::DOUBLE = 6 |
8-byte long floating-point number.
const Apache\Ignite\Type\ObjectType::DOUBLE_ARRAY = 17 |
Array of floating point numbers with double precision.
const Apache\Ignite\Type\ObjectType::ENUM = 28 |
Value of an enumerable type. For such types defined only a finite number of named values.
const Apache\Ignite\Type\ObjectType::ENUM_ARRAY = 29 |
Array of enumerable type value.
const Apache\Ignite\Type\ObjectType::FLOAT = 5 |
4-byte long floating-point number.
const Apache\Ignite\Type\ObjectType::FLOAT_ARRAY = 16 |
Array of floating point numbers.
const Apache\Ignite\Type\ObjectType::INTEGER = 3 |
4-bytes long signed integer number.
const Apache\Ignite\Type\ObjectType::INTEGER_ARRAY = 14 |
Array of signed integer numbers.
const Apache\Ignite\Type\ObjectType::LONG = 4 |
8-bytes long signed integer number.
const Apache\Ignite\Type\ObjectType::LONG_ARRAY = 15 |
Array of long signed integer numbers.
const Apache\Ignite\Type\ObjectType::MAP = 25 |
Map-like collection type. Contains pairs of key and value objects.
const Apache\Ignite\Type\ObjectType::NULL = 101 |
null value.
const Apache\Ignite\Type\ObjectType::OBJECT_ARRAY = 23 |
Array of objects of any type.
const Apache\Ignite\Type\ObjectType::SHORT = 2 |
2-bytes long signed integer number.
const Apache\Ignite\Type\ObjectType::SHORT_ARRAY = 13 |
Array of short signed integer numbers.
const Apache\Ignite\Type\ObjectType::STRING = 9 |
String in UTF-8 encoding.
const Apache\Ignite\Type\ObjectType::STRING_ARRAY = 20 |
Array of UTF-8 string values.
const Apache\Ignite\Type\ObjectType::TIME = 36 |
Time, represented as a number of milliseconds elapsed since midnight, i.e. 00:00:00 UTC.
const Apache\Ignite\Type\ObjectType::TIME_ARRAY = 37 |
Array of time values.
const Apache\Ignite\Type\ObjectType::TIMESTAMP = 33 |
More precise than a Date data type. Except for a milliseconds since epoch, contains a nanoseconds fraction of a last millisecond, which value could be in a range from 0 to 999999.
const Apache\Ignite\Type\ObjectType::TIMESTAMP_ARRAY = 34 |
Array of timestamp values.
const Apache\Ignite\Type\ObjectType::UUID = 10 |
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer systems.
const Apache\Ignite\Type\ObjectType::UUID_ARRAY = 21 |
Array of UUIDs.