public function __construct(AspectCondition $condition) { $this->name = $condition->getName(); $this->valueArray = $condition->getValueList(); $this->translationName = $condition->getTranslationName(); $this->translationValueArray = $condition->getTranslationValueList(); }
public function __construct($data) { $this->price = new Price($data['price'], $data['currency']); $this->amount = $data['amount']; $this->imageArray = $data['images']; $aspectArray = array(); $this->sku = $this->generateSku($data['aspects']['original']); foreach ($data['aspects']['original'] as $name => $valueList) { $cond = new AspectCondition(); $translationAspect = each($data['aspects']['translation']); $cond->setName($name)->setValueList($valueList)->setTranslationName($translationAspect['key'])->setTranslationValueList($translationAspect['value']); $aspectArray[] = new Aspect($cond); } $this->aspectList = new \ArrayIterator($aspectArray); }