예제 #1
0
 /**
  * @param string $type
  * @param string $name
  * @param string|null $code
  */
 private function createProductAttribute($type, $name, $code = null)
 {
     $productAttribute = $this->productAttributeFactory->createTyped($type);
     if (null === $code) {
         $code = StringInflector::nameToUppercaseCode($name);
     }
     $productAttribute->setCode($code);
     $productAttribute->setName($name);
     $this->productAttributeRepository->add($productAttribute);
     $this->sharedStorage->set('product_attribute', $productAttribute);
 }
 /**
  * @param string $type
  * @param string $name
  * @param string|null $code
  */
 private function createProductAttribute($type, $name, $code = null)
 {
     $productAttribute = $this->productAttributeFactory->createTyped($type);
     if (null === $code) {
         $code = str_replace(' ', '_', strtoupper($name));
     }
     $productAttribute->setCode($code);
     $productAttribute->setName($name);
     $this->productAttributeRepository->add($productAttribute);
     $this->sharedStorage->set('product_attribute', $productAttribute);
 }
예제 #3
0
 /**
  * @param ProductAttributeInterface $productAttribute
  */
 private function saveProductAttribute(ProductAttributeInterface $productAttribute)
 {
     $this->productAttributeRepository->add($productAttribute);
     $this->sharedStorage->set('product_attribute', $productAttribute);
 }