Mage_CatalogIndex_Model_Mysql4_Indexer_Minimalprice Class Reference

Inheritance diagram for Mage_CatalogIndex_Model_Mysql4_Indexer_Minimalprice:

Mage_CatalogIndex_Model_Mysql4_Indexer_Abstract Mage_Core_Model_Mysql4_Abstract Mage_Core_Model_Resource_Abstract

List of all members.

Public Member Functions

 getMinimalValue ($conditions)
 cleanup ($productId, $storeId=null, $attributeId=null)

Protected Member Functions

 _construct ()


Detailed Description

Price indexer resource model

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

Definition at line 33 of file Minimalprice.php.


Member Function Documentation

_construct (  )  [protected]

should be defined because abstract

Reimplemented from Mage_CatalogIndex_Model_Mysql4_Indexer_Abstract.

Definition at line 35 of file Minimalprice.php.

00036     {
00037         $this->_init('catalogindex/minimal_price', 'index_id');
00038 
00039         $this->_entityIdFieldName   = 'entity_id';
00040         $this->_storeIdFieldName    = 'store_id';
00041     }

cleanup ( productId,
storeId = null,
attributeId = null 
)

Reimplemented from Mage_CatalogIndex_Model_Mysql4_Indexer_Abstract.

Definition at line 58 of file Minimalprice.php.

00059     {
00060         $conditions[] = $this->_getWriteAdapter()->quoteInto("{$this->_entityIdFieldName} = ?", $productId);
00061 
00062         if (!is_null($storeId))
00063             $conditions[] = $this->_getWriteAdapter()->quoteInto("{$this->_storeIdFieldName} = ?", $storeId);
00064 
00065         $conditions = implode (' AND ', $conditions);
00066         $this->_getWriteAdapter()->delete($this->getMainTable(), $conditions);
00067     }

getMinimalValue ( conditions  ) 

Definition at line 43 of file Minimalprice.php.

00044     {
00045         $select = $this->_getReadAdapter()->select();
00046         $select->from($this->getTable('catalogindex/price'), 'MIN(value)');
00047         foreach ($conditions as $field=>$value) {
00048             $condition = "{$field} = ?";
00049             if (is_array($value))
00050                 $condition = "{$field} in (?)";
00051 
00052             $select->where($condition, $value);
00053         }
00054 
00055         return $this->_getReadAdapter()->fetchOne($select);
00056     }


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

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