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 ProductJsonSerializer

Class ProductJsonSerializer

This class will serialize and deserialize a Product 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 ProductJsonSerializer
Package: Extensions\Serializers
Category: System
Located at Extensions/Serializers/ProductJsonSerializer.inc.php

Methods summary

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

Serialize a Product object to a JSON string.

Serialize a Product object to a JSON string.

Parameters

$object
Object instance to be serialized.
$encode

(optional) Whether to json_encode the result of the method (default true).

Returns

string|array

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

Throws

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

Deserialize a Product JSON String.

Deserialize a Product JSON String.

Parameters

$string
JSON string that contains the data of the product.
$baseObject

(optional) If provided, this will be the base object to be updated and no new instance will be created.

Returns

ProductInterface
Returns the deserialized Product object.

Throws

InvalidArgumentException
If the argument is not a string or is empty.
protected array
# _serializeImages( ProductImageContainerInterface $imageContainer )

Serialize Images

Serialize Images

Parameters

$imageContainer

Returns

array
protected ProductImageContainer
# _deserializeImages( $json )

Deserialize Images

Deserialize Images

Parameters

$json

Returns

ProductImageContainer

Throws

InvalidArgumentException
Through "addAdditional"
RuntimeException
Through "_deserializeLanguageSpecificProperty"
protected array
# _serializeSettings( ProductSettingsInterface $settings )

Serialize Settings

Serialize Settings

Parameters

$settings

Returns

array
protected ProductSettingsInterface
# _deserializeSettings( ProductSettingsInterface $settings, $json )

Deserialize Settings

Deserialize Settings

Parameters

$settings
$json

Returns

ProductSettingsInterface

Methods inherited from AbstractJsonSerializer

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

Properties summary

Properties inherited from AbstractJsonSerializer

$languageProvider

API documentation generated by ApiGen