Class Mage_CatalogRule_Model_Resource_Rule
Catalog rules resource model
- Mage_Core_Model_Resource_Abstract
- Mage_Core_Model_Resource_Db_Abstract
- Mage_Rule_Model_Resource_Abstract
- Mage_CatalogRule_Model_Resource_Rule
Direct known subclasses
Mage_CatalogRule_Model_Mysql4_RuleCategory: Mage
Copyright: Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
License: Open Software License (OSL 3.0)
Author: Magento Core Team <core@magentocommerce.com>
Located at code/core/Mage/CatalogRule/Model/Resource/Rule.php
protected
|
|
protected
|
#
_afterLoad(
Add customer group ids and website ids to rule data after load |
protected
|
#
_afterSave(
Bind catalog rule to customer group(s) and website(s). Update products which are matched for rule. |
public
|
#
updateRuleProductData(
Update products which are matched for rule |
public
array
|
|
public
|
#
removeCatalogPricesForDateRange( integer|string $fromDate, integer|string $toDate, integer|null $productId = null )
Remove catalog rules product prices for specified date range and product |
public
|
|
protected
Zend_Db_Statement_Interface
|
#
_getRuleProductsStmt( integer $fromDate, integer $toDate, integer|null $productId = null, integer|null $websiteId = null )
Get DB resource statement for processing query result |
public
|
#
applyAllRulesForDateRange( integer|string|null $fromDate = null, integer|string|null $toDate = null, integer $productId = null )
Generate catalog price rules prices for specified date range If from date is not defined - will be used previous day by UTC If to date is not defined - will be used next day by UTC |
protected
float
|
#
_calcRuleProductPrice( array $ruleData, null|array $productData = null )
Calculate product price based on price rule data and previous information |
protected
|
|
public
float|boolean
|
#
getRulePrice( integer|string $date, integer $wId, integer $gId, integer $pId )
Get catalog rules product price for specific date, website and customer group |
public
array
|
#
getRulePrices( integer|string $date, integer $websiteId, integer $customerGroupId, array $productIds )
Retrieve product prices by catalog rule for specific date, website and customer group Collect data with product Id => price pairs |
public
array
|
#
getRulesFromProduct( integer|string $date, integer $websiteId, integer $customerGroupId, integer $productId )
Get active rule data based on few filters |
public
array
|
#
getRulesForProduct( integer|string $date, integer $wId, integer $pId )
Retrieve product price data for all customer groups |
public
|
#
applyToProduct(
Apply catalog rule to product |
integer |
SECONDS_IN_DAY
|
86400 |
#
Store number of seconds in a day |
protected
array
|
$_associatedEntitiesMap | array(
'website' => array(
'associations_table' => 'catalogrule/website',
'rule_id_field' => 'rule_id',
'entity_id_field' => 'website_id'
),
'customer_group' => array(
'associations_table' => 'catalogrule/customer_group',
'rule_id_field' => 'rule_id',
'entity_id_field' => 'customer_group_id'
)
) |
#
Store associated with rule entities information map |
$_commitCallbacks
|