Class Mage_CatalogRule_Model_Mysql4_Rule

Description

Catalog rules resource model

Located in /CatalogRule/Model/Mysql4/Rule.php (line 30)

Mage_Core_Model_Resource_Abstract
   |
   --Mage_Core_Model_Mysql4_Abstract
      |
      --Mage_CatalogRule_Model_Mysql4_Rule
Class Constant Summary
SECONDS_IN_DAY = 86400
Method Summary
Mage_CatalogRule_Model_Mysql4_Rule applyAllRulesForDateRange ([int|string|null $fromDate = null], [int|string|null $toDate = null], [int $productId = null])
Mage_CatalogRule_Model_Mysql4_Rule deleteOldData ( $date, [mixed $productId = null], int $maxDate)
float getRulePrice (int|string $date, int $wId, int $gId, int $pId)
array getRulePrices (int|string $date, int $websiteId, int $customerGroupId, array $productIds)
array getRuleProductIds (int $ruleId)
false|array getRuleProductsForDateRange (int|string $fromDate, int|string $toDate, [int|null $productId = null])
array getRulesForProduct (int|string $date, int $wId, int $pId)
array getRulesFromProduct (int|string $date, int $websiteId, int $customerGroupId, int $productId)
Mage_CatalogRule_Model_Mysql4_Rule removeCatalogPricesForDateRange (int|string $fromDate, int|string $toDate, [int|null $productId = null])
void _beforeSave ( $object)
float _calcRuleProductPrice (array $ruleData, [null|array $productData = null])
void _construct ()
Zend_Db_Statement_Interface _getRuleProductsStmt (int $fromDate, int $toDate, [int|null $productId = null], [int|null $websiteId = null])
Variables
Methods
applyAllRulesForDateRange (line 394)

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

  • access: public
Mage_CatalogRule_Model_Mysql4_Rule applyAllRulesForDateRange ([int|string|null $fromDate = null], [int|string|null $toDate = null], [int $productId = null])
  • int|string|null $fromDate
  • int|string|null $toDate
  • int $productId
applyToProduct (line 703)

Apply catalog rule to product

  • access: public
Mage_CatalogRule_Model_Mysql4_Rule applyToProduct (Mage_CatalogRule_Model_Rule $rule, Mage_Catalog_Model_Product $product, array $websiteIds)
deleteOldData (line 207)

Delete old price rules data

  • access: public
Mage_CatalogRule_Model_Mysql4_Rule deleteOldData ( $date, [mixed $productId = null], int $maxDate)
  • int $maxDate
  • mixed $productId
  • $date
getRulePrice (line 614)

Get catalog rules product price for specific date, website and customer group

  • return: | false
  • access: public
float getRulePrice (int|string $date, int $wId, int $gId, int $pId)
  • int|string $date
  • int $wId
  • int $gId
  • int $pId
getRulePrices (line 634)

Return product prices by catalog rule for specific date, website and customer group Return product - price pairs

  • access: public
array getRulePrices (int|string $date, int $websiteId, int $customerGroupId, array $productIds)
  • int|string $date
  • int $websiteId
  • int $customerGroupId
  • array $productIds
getRuleProductIds (line 160)

Get all product ids matched for rule

  • access: public
array getRuleProductIds (int $ruleId)
  • int $ruleId
getRuleProductsForDateRange (line 229)

Get rules data for all products in specified date range

deprecated

  • access: public
false|array getRuleProductsForDateRange (int|string $fromDate, int|string $toDate, [int|null $productId = null])
  • int|string $fromDate
  • int|string $toDate
  • int|null $productId
getRulesForProduct (line 684)

Get data about product prices for all customer groups

  • access: public
array getRulesForProduct (int|string $date, int $wId, int $pId)
  • int|string $date
  • int $wId
  • int $pId
getRulesFromProduct (line 655)

Get active rule data based on few filters

  • access: public
array getRulesFromProduct (int|string $date, int $websiteId, int $customerGroupId, int $productId)
  • int|string $date
  • int $websiteId
  • int $customerGroupId
  • int $productId
removeCatalogPricesForDateRange (line 176)

Remove catalog rules product prices for specified date range and product

  • access: public
Mage_CatalogRule_Model_Mysql4_Rule removeCatalogPricesForDateRange (int|string $fromDate, int|string $toDate, [int|null $productId = null])
  • int|string $fromDate
  • int|string $toDate
  • int|null $productId
updateRuleProductData (line 77)

Update products which are matched for rule

  • access: public
_beforeSave (line 47)

Prepare object data for saving

  • access: public
void _beforeSave ( $object)

Redefinition of:
Mage_Core_Model_Mysql4_Abstract::_beforeSave()
Perform actions before object save
_calcRuleProductPrice (line 550)

Calculate product price based on price rule data and previous information

  • access: protected
float _calcRuleProductPrice (array $ruleData, [null|array $productData = null])
  • array $ruleData
  • null|array $productData
_construct (line 37)

Initialize main table and table id field

  • access: protected
void _construct ()

Redefinition of:
Mage_Core_Model_Resource_Abstract::_construct()
Resource initialization
_getRuleProductsStmt (line 301)

Get DB resource statment for processing query result

  • access: protected
Zend_Db_Statement_Interface _getRuleProductsStmt (int $fromDate, int $toDate, [int|null $productId = null], [int|null $websiteId = null])
  • int $fromDate
  • int $toDate
  • int|null $productId
  • int|null $websiteId
_saveRuleProductPrices (line 579)

Save rule prices for products to DB

  • access: protected
Mage_CatalogRule_Model_Mysql4_Rule _saveRuleProductPrices (array $arrData)
  • array $arrData

Inherited Methods

Inherited From Mage_Core_Model_Mysql4_Abstract

Mage_Core_Model_Mysql4_Abstract::addUniqueField()
Mage_Core_Model_Mysql4_Abstract::afterLoad()
Mage_Core_Model_Mysql4_Abstract::delete()
Mage_Core_Model_Mysql4_Abstract::forsedSave()
Mage_Core_Model_Mysql4_Abstract::getChecksum()
Mage_Core_Model_Mysql4_Abstract::getIdFieldName()
Mage_Core_Model_Mysql4_Abstract::getMainTable()
Mage_Core_Model_Mysql4_Abstract::getReadConnection()
Mage_Core_Model_Mysql4_Abstract::getTable()
Mage_Core_Model_Mysql4_Abstract::getUniqueFields()
Mage_Core_Model_Mysql4_Abstract::getValueTable()
Mage_Core_Model_Mysql4_Abstract::hasDataChanged()
Mage_Core_Model_Mysql4_Abstract::load()
Mage_Core_Model_Mysql4_Abstract::resetUniqueField()
Mage_Core_Model_Mysql4_Abstract::save()
Mage_Core_Model_Mysql4_Abstract::unserializeFields()
Mage_Core_Model_Mysql4_Abstract::_afterDelete()
Mage_Core_Model_Mysql4_Abstract::_afterLoad()
Mage_Core_Model_Mysql4_Abstract::_afterSave()
Mage_Core_Model_Mysql4_Abstract::_beforeDelete()
Mage_Core_Model_Mysql4_Abstract::_beforeSave()
Mage_Core_Model_Mysql4_Abstract::_checkUnique()
Mage_Core_Model_Mysql4_Abstract::_getConnection()
Mage_Core_Model_Mysql4_Abstract::_getLoadSelect()
Mage_Core_Model_Mysql4_Abstract::_getReadAdapter()
Mage_Core_Model_Mysql4_Abstract::_getWriteAdapter()
Mage_Core_Model_Mysql4_Abstract::_init()
Mage_Core_Model_Mysql4_Abstract::_initUniqueFields()
Mage_Core_Model_Mysql4_Abstract::_prepareDataForSave()
Mage_Core_Model_Mysql4_Abstract::_prepareDataForTable()
Mage_Core_Model_Mysql4_Abstract::_prepareValueForSave()
Mage_Core_Model_Mysql4_Abstract::_serializeFields()
Mage_Core_Model_Mysql4_Abstract::_setMainTable()
Mage_Core_Model_Mysql4_Abstract::_setResource()

Inherited From Mage_Core_Model_Resource_Abstract

Mage_Core_Model_Resource_Abstract::__construct()
Mage_Core_Model_Resource_Abstract::addCommitCallback()
Mage_Core_Model_Resource_Abstract::beginTransaction()
Mage_Core_Model_Resource_Abstract::commit()
Mage_Core_Model_Resource_Abstract::formatDate()
Mage_Core_Model_Resource_Abstract::mktime()
Mage_Core_Model_Resource_Abstract::rollBack()
Mage_Core_Model_Resource_Abstract::_construct()
Mage_Core_Model_Resource_Abstract::_getReadAdapter()
Mage_Core_Model_Resource_Abstract::_getWriteAdapter()
Mage_Core_Model_Resource_Abstract::_serializeField()
Mage_Core_Model_Resource_Abstract::_unserializeField()
Class Constants
SECONDS_IN_DAY = 86400 (line 32)

Inherited Constants

Inherited from Mage_Core_Model_Mysql4_Abstract

Mage_Core_Model_Mysql4_Abstract::CHECKSUM_KEY_NAME

Documentation generated on Fri, 11 Feb 2011 17:11:41 +0200 by phpDocumentor 1.4.3