Beispiel #1
0
 /**
  * Load label for configurable attribute
  *
  * @param ConfigurableAttribute $object
  * @return $this
  */
 protected function loadLabel(ConfigurableAttribute $object)
 {
     $storeId = (int) $this->_storeManager->getStore()->getId();
     $connection = $this->_getReadAdapter();
     $useDefaultCheck = $connection->getCheckSql('store.use_default IS NULL', 'def.use_default', 'store.use_default');
     $labelCheck = $connection->getCheckSql('store.value IS NULL', 'def.value', 'store.value');
     $select = $connection->select()->from(array('def' => $this->_labelTable))->joinLeft(array('store' => $this->_labelTable), $connection->quoteInto('store.product_super_attribute_id = def.product_super_attribute_id AND store.store_id = ?', $storeId), array('use_default' => $useDefaultCheck, 'label' => $labelCheck))->where('def.product_super_attribute_id = ?', $object->getId())->where('def.store_id = ?', 0);
     $data = $connection->fetchRow($select);
     $object->setLabel($data['label']);
     $object->setUseDefault($data['use_default']);
     return $this;
 }