PHP Client for Apache Ignite
Public Member Functions | List of all members
Apache\Ignite\Type\ComplexObjectType Class Reference
Inheritance diagram for Apache\Ignite\Type\ComplexObjectType:
Apache\Ignite\Type\ObjectType

Public Member Functions

 __construct ()
 
 setPhpClassName (?string $phpClassName)
 
 getPhpClassName ()
 
 setIgniteTypeName (?string $typeName)
 
 getIgniteTypeName ()
 
 setFieldType (string $fieldName, $fieldType)
 
 getFieldType (string $fieldName)
 
- Public Member Functions inherited from Apache\Ignite\Type\ObjectType
 getTypeCode ()
 

Additional Inherited Members

- Public Attributes inherited from Apache\Ignite\Type\ObjectType
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
 
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
 

Detailed Description

Class representing a complex type of Ignite object.

It corresponds to the ObjectType::COMPLEX_OBJECT Ignite type code.

This class may be needed to help Ignite client to:

Note: only public properties of PHP objects can be serialized/deserialized.

Constructor & Destructor Documentation

◆ __construct()

Apache\Ignite\Type\ComplexObjectType::__construct ( )

Public constructor.

Creates a default representation of Ignite complex object type. setPhpClassName(), setIgniteTypeName(), setFieldType() methods may be used to change the default representation.

Member Function Documentation

◆ getFieldType()

Apache\Ignite\Type\ComplexObjectType::getFieldType ( string  $fieldName)

Gets Ignite type of the indicated field in the complex type.

Parameters
string$fieldNamename of the field.
Returns
int|ObjectType|null Ignite type of the field:
  • either a type code of primitive (simple) type (PrimitiveTypeCodes)
  • or an instance of class representing non-primitive (composite) type
  • or null that means the type is not specified

◆ getIgniteTypeName()

Apache\Ignite\Type\ComplexObjectType::getIgniteTypeName ( )

Gets the name of the Ignite complex type.

Returns
string|null name of the Ignite complex type or null (the name is not specified).

◆ getPhpClassName()

Apache\Ignite\Type\ComplexObjectType::getPhpClassName ( )

Gets the name of the PHP class.

Returns
string|null name of the PHP class or null (the name is not specified).

◆ setFieldType()

Apache\Ignite\Type\ComplexObjectType::setFieldType ( string  $fieldName,
  $fieldType 
)

Specifies Ignite type of the indicated field in the complex type.

Affects data writing operations only.

During data serialization Ignite client will assume that the indicated field has the Ignite type specified by this method.

By default (if the type of the field is not specified), Ignite client tries to make automatic mapping between PHP types and Ignite object types - according to the mapping table defined in the description of the ObjectType class.

Parameters
string$fieldNamename of the field.
int | ObjectType | null$fieldTypeIgnite type of the field:
  • either a type code of primitive (simple) type (PrimitiveTypeCodes)
  • or an instance of class representing non-primitive (composite) type
  • or null (or not specified) that means the type is not specified
Returns
ComplexObjectType the same instance of the ComplexObjectType.
Exceptions
ClientExceptionif error.

◆ setIgniteTypeName()

Apache\Ignite\Type\ComplexObjectType::setIgniteTypeName ( ?string  $typeName)

Sets the name of the Ignite complex type.

Affects data writing operations only.

The specified name will be used as the Ignite complex type name during the complex object's writing operations.

By default (if the name is not specified), the Ignite complex type name of the serialized complex object is taken from the name of the PHP class which instance is provided in a data writing operation.

Parameters
string | null$typeNamename of the Ignite complex type or null (the name is not specified).
Returns
ComplexObjectType the same instance of the ComplexObjectType.

◆ setPhpClassName()

Apache\Ignite\Type\ComplexObjectType::setPhpClassName ( ?string  $phpClassName)

Sets the name of the PHP class.

Affects data reading operations only.

The specified name will be used as PHP class name to instantiate a PHP object the received Ignite complex object is deserialized to.

By default (if the name is not specified), the Ignite complex type name of the received complex object is used as PHP class name to instantiate a PHP object during deserialization.

The PHP Class must have a constructor without parameters or with optional parameters only.

Parameters
string | null$phpClassNamename of the PHP class or null (the name is not specified).
Returns
ComplexObjectType the same instance of the ComplexObjectType.

The documentation for this class was generated from the following file: