Public Member Functions | |
loadByCustomerRule ($rule, $customerId, $ruleId) | |
Protected Member Functions | |
_construct () |
Definition at line 29 of file Customer.php.
_construct | ( | ) | [protected] |
Resource initialization
Reimplemented from Mage_Core_Model_Resource_Abstract.
Definition at line 31 of file Customer.php.
00032 { 00033 $this->_init('salesrule/rule_customer', 'rule_customer_id'); 00034 }
loadByCustomerRule | ( | $ | rule, | |
$ | customerId, | |||
$ | ruleId | |||
) |
Get rule usage record for a customer
Mage_SalesRule_Model_Rule_Customer | $rule | |
int | $customerId | |
int | $ruleId |
Definition at line 44 of file Customer.php.
00045 { 00046 $read = $this->_getReadAdapter(); 00047 $select = $read->select()->from($this->getMainTable()) 00048 ->where('customer_id=?', $customerId) 00049 ->where('rule_id=?', $ruleId); 00050 $data = $read->fetchRow($select); 00051 if (false === $data) { 00052 // set empty data, as an existing rule object might be used 00053 $data = array(); 00054 } 00055 $rule->setData($data); 00056 return $this; 00057 }