Public Member Functions | |
createIndexData (Mage_Catalog_Model_Product $object, Mage_Eav_Model_Entity_Attribute_Abstract $attribute=null) | |
Protected Member Functions | |
_construct () | |
_isAttributeIndexable (Mage_Eav_Model_Entity_Attribute_Abstract $attribute) | |
_getIndexableAttributeConditions () |
Definition at line 33 of file Eav.php.
_construct | ( | ) | [protected] |
Enter description here...
Reimplemented from Varien_Object.
Definition at line 35 of file Eav.php.
00036 { 00037 $this->_init('catalogindex/indexer_eav'); 00038 return parent::_construct(); 00039 }
_getIndexableAttributeConditions | ( | ) | [protected] |
Reimplemented from Mage_CatalogIndex_Model_Indexer_Abstract.
Definition at line 78 of file Eav.php.
00079 { 00080 $conditions = "frontend_input IN ('select', 'multiselect') AND (is_filterable IN (1, 2) OR is_visible_in_advanced_search = 1)"; 00081 return $conditions; 00082 00083 $conditions = array(); 00084 $conditions['frontend_input'] = array('select', 'multiselect'); 00085 $conditions['or']['is_filterable'] = array(1, 2); 00086 $conditions['or']['is_visible_in_advanced_search'] = 1; 00087 }
_isAttributeIndexable | ( | Mage_Eav_Model_Entity_Attribute_Abstract $ | attribute | ) | [protected] |
Reimplemented from Mage_CatalogIndex_Model_Indexer_Abstract.
Definition at line 66 of file Eav.php.
00067 { 00068 if ($attribute->getIsFilterable() == 0 && $attribute->getIsVisibleInAdvancedSearch() == 0) { 00069 return false; 00070 } 00071 if ($attribute->getFrontendInput() != 'select' && $attribute->getFrontendInput() != 'multiselect') { 00072 return false; 00073 } 00074 00075 return true; 00076 }
createIndexData | ( | Mage_Catalog_Model_Product $ | object, | |
Mage_Eav_Model_Entity_Attribute_Abstract $ | attribute = null | |||
) |
Implements Mage_CatalogIndex_Model_Indexer_Interface.
Definition at line 41 of file Eav.php.
00042 { 00043 $data = array(); 00044 00045 $data['store_id'] = $attribute->getStoreId(); 00046 $data['entity_id'] = $object->getId(); 00047 $data['attribute_id'] = $attribute->getId(); 00048 $data['value'] = $object->getData($attribute->getAttributeCode()); 00049 00050 if ($attribute->getFrontendInput() == 'multiselect') { 00051 $origData = $data; 00052 $data = array(); 00053 00054 $value = explode(',', $origData['value']); 00055 foreach ($value as $item) { 00056 $row = $origData; 00057 $row['value'] = $item; 00058 $data[] = $row; 00059 } 00060 } 00061 00062 //return $this->_spreadDataForStores($object, $attribute, $data); 00063 return $data; 00064 }