Documentation

Factory
in package

Class Factory

Creates single products (factory-style)

Table of Contents

$types  : array<string|int, mixed>
Available product types
create()  : Product
Creates 'Product' instance matching given type

Properties

$types

Available product types

public static array<string|int, mixed> $types = [ # (1) Books 'AG' => 'ePublikation', 'HC' => 'Hardcover', 'SB' => 'Schulbuch', 'TB' => 'Taschenbuch', # (2) Media 'AC' => 'Hörbuch', 'AD' => 'Film', 'AF' => 'Tonträger', 'AK' => 'Musik', # (3) Nonbook 'AB' => 'Nonbook', 'AE' => 'Software', 'AH' => 'Games', 'AI' => 'Kalender', 'AJ' => 'Landkarte/Globus', 'AL' => 'Noten', 'AM' => 'Papeterie/PBS', 'AN' => 'Spiel', 'AO' => 'Spielzeug', ]

Methods

create()

Creates 'Product' instance matching given type

public static create(array<string|int, mixed> $data) : Product
Parameters
$data : array<string|int, mixed>

Raw product data

Tags
throws
UnknownTypeException
Return values
Product

Search results