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 ZoneJsonSerializer

Class ZoneJsonSerializer

This class will serialize and deserialize a zone entity. It can be used into many places where PHP interacts with external requests such as AJAX or API communication.

AbstractJsonSerializer implements SerializerInterface
Extended by ZoneJsonSerializer
Package: Extensions\Serializers
Category: System
Located at Extensions/Serializers/ZoneJsonSerializer.inc.php

Methods summary

public string|array
# serialize( CustomerCountryZoneInterface $object, boolean $encode = true )

Serialize zone object to json string.

Serialize zone object to json string.

Parameters

$object
Contains the zone data.
$encode

(optional) Whether to json_encode the result of the method (default true). Sometimes it might be required to encode an array of multiple zone records together and not one by one.

Returns

string|array

Returns the json encoded zone (string) or an array that can be easily encoded into a JSON string.

Throws

InvalidArgumentException
If the provided object type is invalid.
public CustomerCountryZoneInterface
# deserialize( string $string, object $baseObject = null )

Deserialize zone JSON string.

Deserialize zone JSON string.

NOTICE #1: The CountryService does not support the addition of new zones so the CustomerCountryZone object does not have any setters, rather only getters. So the $baseObject parameter is not used at all.

NOTICE #2: The provided JSON string must contain all the properties of the zone otherwise the object will not be deserialized.

Parameters

$string
JSON string that contains the data of the country.
$baseObject
(optional) It is not used within the countries context.

Returns

CustomerCountryZoneInterface
Returns the deserialized CustomerCountry object.

Throws

InvalidArgumentException
If the argument is not a string or is empty.

Methods inherited from AbstractJsonSerializer

__construct(), _deserializeAddonValues(), _deserializeLanguageSpecificProperty(), _serializeAddonValues(), _serializeLanguageSpecificProperty(), jsonEncode()

Properties summary

Properties inherited from AbstractJsonSerializer

$languageProvider

API documentation generated by ApiGen