Mage_Downloadable_Model_Mysql4_Sample_Collection Class Reference

Inheritance diagram for Mage_Downloadable_Model_Mysql4_Sample_Collection:

Mage_Core_Model_Mysql4_Collection_Abstract Varien_Data_Collection_Db Varien_Data_Collection

List of all members.

Public Member Functions

 addProductToFilter ($product)
 addTitleToResult ($storeId=0)

Protected Member Functions

 _construct ()


Detailed Description

Definition at line 34 of file Collection.php.


Member Function Documentation

_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/sample');
00044     }

addProductToFilter ( product  ) 

Enter description here...

Parameters:
Mage_Catalog_Model_Product|array|integer|null $product
Returns:
Mage_Downloadable_Model_Mysql4_Sample_Collection

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...

Parameters:
integer $storeId
Returns:
Mage_Downloadable_Model_Mysql4_Sample_Collection

Definition at line 73 of file Collection.php.

00074     {
00075         $this->getSelect()
00076             ->joinLeft(array('default_title_table' => $this->getTable('downloadable/sample_title')),
00077                 '`default_title_table`.sample_id=`main_table`.sample_id AND `default_title_table`.store_id = 0',
00078                 array('default_title' => 'title'))
00079             ->joinLeft(array('store_title_table' => $this->getTable('downloadable/sample_title')),
00080                 '`store_title_table`.sample_id=`main_table`.sample_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     }


The documentation for this class was generated from the following file:

Generated on Sat Jul 4 17:24:09 2009 for Magento by  doxygen 1.5.8