Public Member Functions | |
addCustomerFilter ($customer) | |
Protected Member Functions | |
_construct () |
Definition at line 35 of file Collection.php.
_construct | ( | ) | [protected] |
Initialization here
Reimplemented from Mage_Core_Model_Mysql4_Collection_Abstract.
Definition at line 37 of file Collection.php.
00038 { 00039 $this->_init('giftregistry/gift'); 00040 }
addCustomerFilter | ( | $ | customer | ) |
Definition at line 42 of file Collection.php.
00043 { 00044 if ($customer instanceof Mage_Customer_Model_Customer) { 00045 $this->addFieldToFilter('customer_id', $customer->getId()); 00046 } 00047 elseif (is_numeric($customer)) { 00048 $this->addFieldToFilter('customer_id', $customer); 00049 } 00050 elseif (is_array($customer)){ 00051 $this->addFieldToFilter('customer_id', $customer); 00052 } 00053 else { 00054 Mage::throwException( 00055 Mage::helper('giftregistry/test')->__('Invalid parameter for customer filter') 00056 ); 00057 } 00058 00059 return $this; 00060 }