Mage_CatalogIndex_Model_Indexer_Price Class Reference

Inheritance diagram for Mage_CatalogIndex_Model_Indexer_Price:

Mage_CatalogIndex_Model_Indexer_Abstract Mage_Core_Model_Abstract Mage_CatalogIndex_Model_Indexer_Interface Varien_Object

List of all members.

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 ()

Protected Attributes

 $_customerGroups = array()
 $_processChildrenForConfigurable = false


Detailed Description

Catalog indexer price processor

Author:
Magento Core Team <core@magentocommerce.com>

Definition at line 33 of file Price.php.


Member Function Documentation

_construct (  )  [protected]

Enter description here...

Reimplemented from Varien_Object.

Definition at line 38 of file Price.php.

00039     {
00040         $this->_init('catalogindex/indexer_price');
00041         $this->_customerGroups = Mage::getModel('customer/group')->getCollection();
00042     }

_getIndexableAttributeConditions (  )  [protected]

Reimplemented from Mage_CatalogIndex_Model_Indexer_Abstract.

Definition at line 84 of file Price.php.

00085     {
00086         $conditions = "frontend_input = 'price' AND attribute_code <> 'price'";
00087         return $conditions;
00088     }

_isAttributeIndexable ( Mage_Eav_Model_Entity_Attribute_Abstract attribute  )  [protected]

Reimplemented from Mage_CatalogIndex_Model_Indexer_Abstract.

Definition at line 69 of file Price.php.

00070     {
00071         if ($attribute->getFrontendInput() != 'price') {
00072             return false;
00073         }
00074         if ($attribute->getAttributeCode() == 'tier_price') {
00075             return false;
00076         }
00077         if ($attribute->getAttributeCode() == 'minimal_price') {
00078             return false;
00079         }
00080 
00081         return true;
00082     }

createIndexData ( Mage_Catalog_Model_Product object,
Mage_Eav_Model_Entity_Attribute_Abstract attribute = null 
)

Implements Mage_CatalogIndex_Model_Indexer_Interface.

Definition at line 44 of file Price.php.

00045     {
00046         $data = array();
00047 
00048         $data['store_id'] = $attribute->getStoreId();
00049         $data['entity_id'] = $object->getId();
00050         $data['attribute_id'] = $attribute->getId();
00051         $data['value'] = $object->getData($attribute->getAttributeCode());
00052 
00053         if ($attribute->getAttributeCode() == 'price') {
00054             $result = array();
00055             foreach ($this->_customerGroups as $group) {
00056                 $object->setCustomerGroupId($group->getId());
00057                 $finalPrice = $object->getFinalPrice();
00058                 $row = $data;
00059                 $row['customer_group_id'] = $group->getId();
00060                 $row['value'] = $finalPrice;
00061                 $result[] = $row;
00062             }
00063             return $result;
00064         }
00065 
00066         return $data;
00067     }


Member Data Documentation

$_customerGroups = array() [protected]

Definition at line 35 of file Price.php.

$_processChildrenForConfigurable = false [protected]

Reimplemented from Mage_CatalogIndex_Model_Indexer_Abstract.

Definition at line 36 of file Price.php.


The documentation for this class was generated from the following file:

Generated on Sat Jul 4 17:23:46 2009 for Magento by  doxygen 1.5.8