/** * 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; } }
/** * Create a product value * * @return ProductValueInterface * * @deprecated will be removed in 1.5, please use ProductBuilderInterface::createProductValue(); */ public function createProductValue(AttributeInterface $attribute) { return $this->builder->createProductValue($attribute); }