This repository has been archived by the owner on Jun 13, 2021. It is now read-only.
Version 0.1.1
Feature
Assigning values when instatiating an object has been improved. It is now possible to simply pass an associative array of property names and values. When a property expects an object as its value you can just pass another associative array instead. For example,
$variation = new Types\VariationType(array(
'SKU' => 'TS-W-S',
'Quantity' => 5,
'StartPrice' => ['value' => 10.99],
'VariationSpecifics' => [[
'NameValueList' => [
['Name' => 'Color', 'Value' => ['White']],
['Name' => "Size (Men's)", 'Value' => ['S']]
]
]]
));
This feature is compatiable with the existing method and so you can mix and match as in the example below.
$variation = new Types\VariationType(array(
'SKU' => 'TS-W-S',
'Quantity' => 5,
'StartPrice' => new Types\AmountType(['value' => 10.99]),
'VariationSpecifics' => [[
'NameValueList' => [
new Types\NameValueListType(['Name' => 'Color', 'Value' => ['White']]),
['Name' => "Size (Men's)", 'Value' => ['S']]
]
]]
));