
Public Member Functions | |
| getMinimalValue ($conditions) | |
| cleanup ($productId, $storeId=null, $attributeId=null) | |
Protected Member Functions | |
| _construct () | |
Definition at line 33 of file Minimalprice.php.
| _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 }
1.5.8