Public Member Functions | |
_construct () | |
useProductItem () | |
addWishlistFilter (Mage_Wishlist_Model_Wishlist $wishlist) | |
addStoreData () | |
load ($p=false, $l=false) | |
Protected Member Functions | |
_getAttributeFieldName ($attributeCode) |
Definition at line 35 of file Collection.php.
_construct | ( | ) |
Initialize resources
Reimplemented from Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection.
Definition at line 38 of file Collection.php.
00039 { 00040 $this->_init('wishlist/item', 'catalog/product'); 00041 }
_getAttributeFieldName | ( | $ | attributeCode | ) | [protected] |
Reimplemented from Mage_Eav_Model_Entity_Collection_Abstract.
Definition at line 84 of file Collection.php.
00085 { 00086 if($attributeCode == 'days_in_wishlist') { 00087 return $this->_joinFields[$attributeCode]['field']; 00088 } 00089 return parent::_getAttributeFieldName($attributeCode); 00090 }
addStoreData | ( | ) |
Definition at line 68 of file Collection.php.
00069 { 00070 if(!isset($this->_joinFields['e_id'])) { 00071 return $this; 00072 } 00073 00074 $dayTable = $this->_getAttributeTableAlias('days_in_wishlist'); 00075 $this->joinField('store_name', 'core/store', 'name', 'store_id=store_id') 00076 ->joinField('days_in_wishlist', 00077 'wishlist/item', 00078 "(TO_DAYS('" . Mage::getSingleton('core/date')->date() . "') - TO_DAYS(DATE_ADD(".$dayTable.".added_at, INTERVAL " .(int) Mage::getSingleton('core/date')->getGmtOffset() . " SECOND)))", 00079 'wishlist_item_id=wishlist_item_id'); 00080 00081 return $this; 00082 }
addWishlistFilter | ( | Mage_Wishlist_Model_Wishlist $ | wishlist | ) |
Definition at line 49 of file Collection.php.
00050 { 00051 $this->_joinFields['e_id'] = array('table'=>'e','field'=>'entity_id'); 00052 $this->joinTable('wishlist/item', 00053 'product_id=e_id', 00054 array( 00055 'wishlist_item_id' => 'wishlist_item_id', 00056 'product_id' => 'product_id', 00057 'store_id' => 'store_id', 00058 'wishlist_id' => 'wishlist_id', 00059 'added_at' => 'added_at', 00060 'description' => 'description' 00061 ), 00062 array('wishlist_id'=>$wishlist->getId()) 00063 ); 00064 00065 return $this; 00066 }
load | ( | $ | printQuery = false , |
|
$ | logQuery = false | |||
) |
Load collection data into object items
Reimplemented from Mage_Eav_Model_Entity_Collection_Abstract.
Definition at line 92 of file Collection.php.
00093 { 00094 return parent::load($p, $l); 00095 }
useProductItem | ( | ) |
Definition at line 43 of file Collection.php.
00044 { 00045 $this->setObject(Mage::getModel('catalog/product')); 00046 return $this; 00047 }