コード例 #1
0
 /**
  * Add all the values required by the given attribute
  *
  * @param AttributeInterface $attribute
  * @param LocaleInterface    $locale
  */
 protected function addValues(AttributeInterface $attribute, $locale)
 {
     if ($attribute->isScopable()) {
         foreach ($locale->getChannels() as $channel) {
             $key = $attribute->getCode() . '_' . $channel->getCode();
             $value = $this->productBuilder->createProductValue($attribute, $locale->getCode(), $channel->getCode());
             $this->productBuilder->addMissingPrices($value);
             $this->values[$key] = $value;
         }
     } else {
         $value = $this->productBuilder->createProductValue($attribute, $locale->getCode());
         $this->productBuilder->addMissingPrices($value);
         $this->values[$attribute->getCode()] = $value;
     }
 }