/** * Returns attribute meta info for record, * e.g. entity_type_id, attribute_id, etc * * @param array $row * @param Mage_Eav_Model_Entity_Attribute $attribute * @return array */ protected function _getAttributeValueInfo($row, $attribute) { return array('attribute_id' => $attribute->getId(), 'entity_type_id' => $attribute->getEntityTypeId(), $this->_getEntityIdField($attribute) => $row[$this->_getEntityIdField($attribute)]); }
/** * get the attribute set collection that an attribute belongs to * @param Mage_Eav_Model_Entity_Attribute $attribute * @return Mage_Eav_Model_Resource_Entity_Attribute_Set_Collection */ public function getAttributeInSets($attribute) { $collection = Mage::getResourceModel('eav/entity_attribute_set_collection')->addFieldToFilter('main_table.entity_type_id', $attribute->getEntityTypeId()); $collection->getSelect()->join(array('entity_attribute' => $this->getTable('eav/entity_attribute')), 'main_table.attribute_set_id = entity_attribute.attribute_set_id', array('entity_attribute_id'))->where('entity_attribute.attribute_id = ?', $attribute->getId()); return $collection; }