Abstract Json Serializer
Serializers that extend this class should parse and encode entities so that they can be used in the shop's APIs.
Serialization must follow the "null" approach in order to enhance response clarity. That means that serializers must provide a null value than an empty string or an omitted node.
category |
System |
---|---|
package |
Extensions |
subpackage |
Serializers |
__construct()
If you override this constructor do not forget to call it from the child class.
deserialize( $string, $baseObject = null)
jsonEncode(array $data) : string
This function provides PHP v5.3 compatibility and it should be used when serialized objects need to be encoded directly from the serializer instance.
array
Contains the data to be JSON encoded.
string
Returns the encoded JSON string that represents the data.
serialize( $object, $encode = true)