Beispiel #1
0
 /**
  * Initialize entity ubject property value
  *
  * Parameter $valueInfo is _getLoadAttributesSelect fetch result row
  *
  * @param array $valueInfo
  * @return $this
  * @throws \Magento\Eav\Exception
  */
 protected function _setItemAttributeValue($valueInfo)
 {
     $entityIdField = $this->getEntity()->getEntityIdField();
     $entityId = $valueInfo[$entityIdField];
     if (!isset($this->_itemsById[$entityId])) {
         throw new \Magento\Eav\Exception(__('Data integrity: No header row found for attribute'));
     }
     $attributeCode = array_search($valueInfo['attribute_id'], $this->_selectAttributes);
     if (!$attributeCode) {
         $attribute = $this->_eavConfig->getCollectionAttribute($this->getEntity()->getType(), $valueInfo['attribute_id']);
         $attributeCode = $attribute->getAttributeCode();
     }
     foreach ($this->_itemsById[$entityId] as $object) {
         $object->setData($attributeCode, $valueInfo['value']);
     }
     return $this;
 }