Utility/Serialization/JsonObjectSerializer.php
- Package
- Default
Package: DefaultJson Serializer to serialize and de serialize.
- Parent(s)
- \IEntitySerializer
- Inherited_from
- \IEntitySerializer
Properties



string $entityName = nullContains name of class which will be serialized or deserialized
Default valuenullDetails- Type
- string



$lastError = nullDefault valuenullDetails- Type
- n/a
Methods



Deserialize( $message, $limitToOne = FALSE) : \ReturnsDeSerializes the specified action entity type.
Parameters| Name | Type | Description |
|---|
| $message | | |
|---|
| $limitToOne | | |
|---|
Returns| Type | Description |
|---|
| \Returns | the de serialized object. |



Deserialize( $message, $limit = FALSE) : stringinheritedDeSerializes the message to Type T.
Inherited from:
Parameters| Name | Type | Description |
|---|
| $message | | |
|---|
| $limit | | |
|---|
Returns| Type | Description |
|---|
| string | Returns the deserialized message. |



Serialize( $entity) : stringSerializes the specified entity.
Parameters| Name | Type | Description |
|---|
| $entity | | |
|---|
Returns| Type | Description |
|---|
| string | Returns the serialize entity in string format. |



Serialize( $entity) : objectinheritedSerializes the specified entity.
Inherited from:
Parameters| Name | Type | Description |
|---|
| $entity | | |
|---|
Returns| Type | Description |
|---|
| object | Returns the serialize entity in string format. |



__construct( $idsLogger = NULL) : voidInitializes a new instance of the JsonObjectSerializer class.
Parameters| Name | Type | Description |
|---|
| $idsLogger | | |
|---|



checkResult(mixed $result) : mixedHandle possible errors and react
Parameters| Name | Type | Description |
|---|
| $result | mixed | |
|---|
Returns 


cleanPhpClassNameToIntuitEntityName(string $phpClassName) : stringstaticinheritedClean a POPO class name (like 'IPPClass') to be an IPP v3 Entity name (like 'Class')
Inherited from:
Parameters| Name | Type | Description |
|---|
| $phpClassName | string | POPO class name |
|---|
Returns| Type | Description |
|---|
| string | Intuit Entity name |



collectResourceURL(string $entity) : voidRetrivies resoure URL (part of URL path) which extracted from domain model entity name
Parameters| Name | Type | Description |
|---|
| $entity | string | |
|---|



convertObject(\stdClass $object, boolean $limitToOne) : mixedConverts stdClass objects into object with specified type
It tries to learn type from JSON responce
Parameters| Name | Type | Description |
|---|
| $object | \stdClass | |
|---|
| $limitToOne | boolean | |
|---|
Returns| Type | Description |
|---|
| mixed | (stdClass or domain model entity) |



decorateIntuitEntityToPhpClassName(\type $intuitEntityName) : \typestaticCreates domain model-like name. In other words it follows naming convetion for SDK
TODO make generic and remove duplicates
Parameters| Name | Type | Description |
|---|
| $intuitEntityName | \type | |
|---|
Returns 


getMessageFromErrorCode(\type $error) : \typeSupport json_last_error_msg in PHP 5.2
Parameters| Name | Type | Description |
|---|
| $error | \type | |
|---|
Returns