Public Member Functions | |
addProductToFilter ($product) | |
addTitleToResult ($storeId=0) | |
addPriceToResult ($websiteId) | |
Protected Member Functions | |
_construct () |
Definition at line 34 of file Collection.php.
_construct | ( | ) | [protected] |
Enter description here...
Reimplemented from Mage_Core_Model_Mysql4_Collection_Abstract.
Definition at line 41 of file Collection.php.
00042 { 00043 $this->_init('downloadable/link'); 00044 }
addPriceToResult | ( | $ | websiteId | ) |
Enter description here...
integer | $websiteId |
Definition at line 94 of file Collection.php.
00095 { 00096 $this->getSelect() 00097 ->joinLeft(array('default_price_table' => $this->getTable('downloadable/link_price')), 00098 '`default_price_table`.link_id=`main_table`.link_id AND `default_price_table`.website_id = 0', 00099 array('default_price' => 'price')) 00100 ->joinLeft(array('website_price_table' => $this->getTable('downloadable/link_price')), 00101 '`website_price_table`.link_id=`main_table`.link_id AND `website_price_table`.website_id = ' . intval($websiteId), 00102 array('website_price' => 'price','price' => new Zend_Db_Expr('IFNULL(`website_price_table`.price, `default_price_table`.price)'))); 00103 return $this; 00104 }
addProductToFilter | ( | $ | product | ) |
Enter description here...
Mage_Catalog_Model_Product|array|integer|null | $product |
Definition at line 52 of file Collection.php.
00053 { 00054 if (empty($product)) { 00055 $this->addFieldToFilter('product_id', ''); 00056 } elseif (is_array($product)) { 00057 $this->addFieldToFilter('product_id', array('in' => $product)); 00058 } elseif ($product instanceof Mage_Catalog_Model_Product) { 00059 $this->addFieldToFilter('product_id', $product->getId()); 00060 } else { 00061 $this->addFieldToFilter('product_id', $product); 00062 } 00063 00064 return $this; 00065 }
addTitleToResult | ( | $ | storeId = 0 |
) |
Enter description here...
integer | $storeId |
Definition at line 73 of file Collection.php.
00074 { 00075 $this->getSelect() 00076 ->joinLeft(array('default_title_table' => $this->getTable('downloadable/link_title')), 00077 '`default_title_table`.link_id=`main_table`.link_id AND `default_title_table`.store_id = 0', 00078 array('default_title'=>'title')) 00079 ->joinLeft(array('store_title_table' => $this->getTable('downloadable/link_title')), 00080 '`store_title_table`.link_id=`main_table`.link_id AND `store_title_table`.store_id = ' . intval($storeId), 00081 array('store_title' => 'title','title' => new Zend_Db_Expr('IFNULL(`store_title_table`.title, `default_title_table`.title)'))) 00082 ->order('main_table.sort_order ASC') 00083 ->order('title ASC'); 00084 00085 return $this; 00086 }