示例#1
0
 public function __construct(AspectCondition $condition)
 {
     $this->name = $condition->getName();
     $this->valueArray = $condition->getValueList();
     $this->translationName = $condition->getTranslationName();
     $this->translationValueArray = $condition->getTranslationValueList();
 }
示例#2
0
 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);
 }