Overview
  • Package
  • Class
  • Tree
  • Todo

Packages

  • AddonValue
    • Interfaces
  • AdminHttpViewControllers
  • ApiV2Controllers
  • Category
    • Collections
    • Entities
    • Factories
    • Interfaces
    • Providers
    • Repositories
    • Storages
  • Customer
    • Address
    • Country
    • CountryZone
    • Interfaces
    • Storages
    • Validation
    • ValueObjects
  • Email
    • Collections
    • Entities
    • Exceptions
    • Interfaces
    • Repository
    • ValueObjects
  • Extensions
    • Customers
    • Emails
    • Helpers
    • Orders
    • Serializers
  • Http
    • Collections
    • Exceptions
    • Factories
    • Interfaces
    • ValueObjects
  • HttpViewControllers
  • InfoBox
    • Interfaces
  • Invoice
    • Interfaces
    • ValueObjects
  • Loaders
    • CrossCuttingLoader
    • GXCoreLoader
    • Interfaces
  • Modules
    • Collections
    • Controllers
    • Interfaces
  • Order
    • Collections
    • Entities
    • Factories
    • Interfaces
    • Repositories
    • Storages
    • ValueObjects
  • Product
    • Collections
    • Entities
    • Factories
    • Interfaces
    • Providers
    • Repositories
    • Storages
  • ProductModule
    • Collections
    • Deleter
    • Entities
    • Factories
    • Interface
    • Interfaces
    • Reader
    • Repositories
    • Writer
  • Shared
    • ClassFinder
    • Exceptions
    • FileSystem
    • Interfaces
    • Storage
    • Types
  • SharedShoppingCart
    • Interfaces
  • Statistics
    • Interfaces
  • UserConfiguration
    • Interfaces
    • Repository

Classes

  • AbstractJsonSerializer
  • AddressJsonSerializer
  • CategoryJsonSerializer
  • CategoryListItemJsonSerializer
  • CountryJsonSerializer
  • CustomerJsonSerializer
  • EmailJsonSerializer
  • OrderJsonSerializer
  • OrderListItemJsonSerializer
  • ProductJsonSerializer
  • ProductListItemJsonSerializer
  • ZoneJsonSerializer

Interfaces

  • SerializerInterface

Class AbstractJsonSerializer

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.

AbstractJsonSerializer implements SerializerInterface

Direct known subclasses

AddressJsonSerializer, CategoryJsonSerializer, ZoneJsonSerializer, CategoryListItemJsonSerializer, CountryJsonSerializer, CustomerJsonSerializer, EmailJsonSerializer, OrderJsonSerializer, OrderListItemJsonSerializer, ProductJsonSerializer, ProductListItemJsonSerializer

Abstract
Package: Extensions\Serializers
Category: System
Located at Extensions/Serializers/AbstractJsonSerializer.inc.php

Methods summary

public
# __construct( )

AbstractJsonSerializer Constructor

AbstractJsonSerializer Constructor

If you override this constructor do not forget to call it from the child class.

abstract public
# serialize( $object, $encode = true )

Implementation of

SerializerInterface::serialize()
abstract public
# deserialize( $string, $baseObject = null )

Implementation of

SerializerInterface::deserialize()
public string
# jsonEncode( array $data )

JSON Encode Wrapper

JSON Encode Wrapper

This function provides PHP v5.3 compatibility and it should be used when serialized objects need to be encoded directly from the serializer instance.

Parameters

$data
Contains the data to be JSON encoded.

Returns

string
Returns the encoded JSON string that represents the data.
protected array
# _serializeAddonValues( KeyValueCollection $addonValues )

Serialize Addon Values

Serialize Addon Values

Common method for serializing addon values in various resource serializer classes.

Parameters

$addonValues

Returns

array
protected array
# _deserializeAddonValues( $json )

Deserialize Addon Values

Deserialize Addon Values

Common method for deserializing addon values in various resource serializer classes.

Parameters

$json

Returns

array
protected array
# _serializeLanguageSpecificProperty( mixed $object, string $property )

Serialize Language Specific Property

Serialize Language Specific Property

In order for this method to work there has to be a proper getter method in the object instance. Otherwise a RuntimeException will be thrown.

Parameters

$object
The object instance containing the property.
$property
The property name to be serialized.

Returns

array

Throws

RuntimeException
If there is no getter for the provided property.
protected
# _deserializeLanguageSpecificProperty( mixed $object, stdobject $json, string $property, $type = 'StringType' )

Deserialize Language Specific Property

Deserialize Language Specific Property

This method will deserialize the value of a JSON property and set the value to the object by using the corresponding setter method.

Parameters

$object
The object being deserialized.
$json
The JSON object containing the property value.
$property
The property name to be deserialized.
$type

Throws

RuntimeException
If the setter method does not exist.

Properties summary

protected LanguageProviderInterface $languageProvider

Used for the resources that require multiple languages.

Used for the resources that require multiple languages.

#
API documentation generated by ApiGen