Public Member Functions | |
addCustomerFilter ($customer) | |
addWebsiteFilter ($website) | |
addStatusFilter ($status) | |
setCustomerOrder ($sort= 'ASC') | |
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('productalert/stock'); 00040 }
addCustomerFilter | ( | $ | customer | ) |
Definition at line 42 of file Collection.php.
00043 { 00044 if (is_array($customer)) { 00045 $condition = $this->getConnection()->quoteInto('customer_id IN(?)', $customer); 00046 } 00047 elseif ($customer instanceof Mage_Customer_Model_Customer) { 00048 $condition = $this->getConnection()->quoteInto('customer_id=?', $customer->getId()); 00049 } 00050 else { 00051 $condition = $this->getConnection()->quoteInto('customer_id=?', $customer); 00052 } 00053 $this->addFilter('customer_id', $condition, 'string'); 00054 return $this; 00055 }
addStatusFilter | ( | $ | status | ) |
Definition at line 75 of file Collection.php.
00076 { 00077 $condition = $this->getConnection()->quoteInto('status=?', $status); 00078 $this->addFilter('status', $condition, 'string'); 00079 return $this; 00080 }
addWebsiteFilter | ( | $ | website | ) |
Definition at line 57 of file Collection.php.
00058 { 00059 if (is_null($website) || $website == 0) { 00060 return $this; 00061 } 00062 if (is_array($website)) { 00063 $condition = $this->getConnection()->quoteInto('website_id IN(?)', $website); 00064 } 00065 elseif ($website instanceof Mage_Core_Model_Website) { 00066 $condition = $this->getConnection()->quoteInto('website_id=?', $website->getId()); 00067 } 00068 else { 00069 $condition = $this->getConnection()->quoteInto('website_id=?', $website); 00070 } 00071 $this->addFilter('website_id', $condition, 'string'); 00072 return $this; 00073 }
setCustomerOrder | ( | $ | sort = 'ASC' |
) |
Definition at line 82 of file Collection.php.
00083 { 00084 $this->getSelect()->order('customer_id ' . $sort); 00085 return $this; 00086 }