Serializer
- Full name:
\Qubus\Support\Serializer\Serializer - This class implements:
\Qubus\Support\Serializer\Serializable
Constants
| Constant | Visibility | Type | Value |
|---|---|---|---|
CLASS_IDENTIFIER_KEY | public | '@type' | |
CLASS_PARENT_KEY | public | '@parent' | |
SCALAR_TYPE | public | '@scalar' | |
SCALAR_VALUE | public | '@value' | |
NULL_VAR | public | null | |
MAP_TYPE | public | '@map' |
Properties
storage
Storage for object.
Used for recursion
mapping
Object mapping for recursion.
mappingIndex
Object mapping index.
strategy
dateTimeClassType
serializationMap
Methods
__construct
Parameters:
| Parameter | Type | Description |
|---|---|---|
$strategy | \Qubus\Support\Serializer\Strategy\Strategy |
getTransformer
This is handy specially in order to add additional data before the serialization process takes place using the transformer public methods, if any.
serialize
Serialize the data.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$data | mixed |
Return Value:
Serialized data.
Throws:
reset
Reset variables.
serializeData
Parse the data to be serialized.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$data | mixed |
Throws:
isInstanceOf
Check if a class is instance or extends from the expected instance.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$value | mixed | |
$classFqn | string |
guardForUnsupportedValues
Parameters:
| Parameter | Type | Description |
|---|---|---|
$data | mixed |
Throws:
unserialize
Unserialize the value from string.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$data | mixed |
Throws:
unserializeData
Parse the json decode to convert to objects again.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$data | mixed |
Throws:
getScalarValue
Parameters:
| Parameter | Type | Description |
|---|---|---|
$value | mixed |
unserializeObject
Convert the serialized array into an object.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$data | array |
Throws:
unserializeDateTimeFamilyObject
Parameters:
| Parameter | Type | Description |
|---|---|---|
$data | array | |
$className | string |
Throws:
isDateTimeFamilyObject
Parameters:
| Parameter | Type | Description |
|---|---|---|
$className | string |
restoreUsingUnserialize
Parameters:
| Parameter | Type | Description |
|---|---|---|
$className | string | |
$attributes | array |
Throws:
unserializeUserDefinedObject
Parameters:
| Parameter | Type | Description |
|---|---|---|
$data | array | |
$className | string |
Throws:
setUnserializedObjectProperties
Parameters:
| Parameter | Type | Description |
|---|---|---|
$data | array | |
$ref | \ReflectionClass | |
$obj | mixed |
Throws:
serializeScalar
Parameters:
| Parameter | Type | Description |
|---|---|---|
$data | mixed |
serializeArray
Parameters:
| Parameter | Type | Description |
|---|---|---|
$data | array |
Throws:
serializeObject
Extract the data from an object.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$data | mixed |
Throws:
serializeInternalClass
Parameters:
| Parameter | Type | Description |
|---|---|---|
$value | mixed | |
$className | string | |
$ref | \ReflectionClass |
getObjectProperties
Return the list of properties to be serialized.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$ref | \ReflectionClass | |
$data | object |
extractObjectData
Extract the object data.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$value | mixed | |
$rc | \ReflectionClass | |
$properties | array |
extractCurrentObjectProperties
protected extractCurrentObjectProperties(mixed $value, \ReflectionClass $rc, array $properties, array& $data): void
Parameters:
| Parameter | Type | Description |
|---|---|---|
$value | mixed | |
$rc | \ReflectionClass | |
$properties | array | |
$data | array |
extractAllInhertitedProperties
Parameters:
| Parameter | Type | Description |
|---|---|---|
$value | mixed | |
$rc | \ReflectionClass | |
$data | array |
isSerialized
Checks if data is serialized.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$data | object|array|string | |
$strict | bool |
Automatically generated on 2025-10-13