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



string $entityName = null
Contains name of class which will be serialized or deserialized
Default valuenull
Details- Type
- string



$lastError = null
Default valuenull
Details- Type
- n/a
Methods



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



Deserialize( $message, $limit = FALSE) : string
inheritedDeSerializes the message to Type T.
Inherited from:
ParametersName | Type | Description |
---|
$message | | |
---|
$limit | | |
---|
ReturnsType | Description |
---|
string | Returns the deserialized message. |



Serialize( $entity) : string
Serializes the specified entity.
ParametersName | Type | Description |
---|
$entity | | |
---|
ReturnsType | Description |
---|
string | Returns the serialize entity in string format. |



Serialize( $entity) : object
inheritedSerializes the specified entity.
Inherited from:
ParametersName | Type | Description |
---|
$entity | | |
---|
ReturnsType | Description |
---|
object | Returns the serialize entity in string format. |



__construct( $idsLogger = NULL) : void
Initializes a new instance of the JsonObjectSerializer class.
ParametersName | Type | Description |
---|
$idsLogger | | |
---|



checkResult(mixed $result) : mixed
Handle possible errors and react
ParametersName | Type | Description |
---|
$result | mixed | |
---|
Returns 


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



collectResourceURL(string $entity) : void
Retrivies resoure URL (part of URL path) which extracted from domain model entity name
ParametersName | Type | Description |
---|
$entity | string | |
---|



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



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


getMessageFromErrorCode(\type $error) : \type
Support json_last_error_msg in PHP 5.2
ParametersName | Type | Description |
---|
$error | \type | |
---|
Returns