Public Member Functions | |
addItemsCount () | |
addCountryFilter ($iso) | |
Protected Member Functions | |
_construct () | |
_initSelect () | |
_joinAttributeSet () |
Definition at line 34 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('googlebase/type'); 00040 }
_initSelect | ( | ) | [protected] |
Reimplemented from Mage_Core_Model_Mysql4_Collection_Abstract.
Definition at line 42 of file Collection.php.
00043 { 00044 parent::_initSelect(); 00045 $this->_joinAttributeSet(); 00046 return $this; 00047 }
_joinAttributeSet | ( | ) | [protected] |
Join Attribute Set data
Definition at line 82 of file Collection.php.
00083 { 00084 $this->getSelect() 00085 ->join( 00086 array('set'=>$this->getTable('eav/attribute_set')), 00087 'main_table.attribute_set_id=set.attribute_set_id', 00088 array('attribute_set_name' => 'set.attribute_set_name')); 00089 return $this; 00090 }
addCountryFilter | ( | $ | iso | ) |
Add country ISO filter to collection
string | $iso Two-letter country ISO code |
Definition at line 71 of file Collection.php.
00072 { 00073 $this->getSelect()->where('target_country=?', $iso); 00074 return $this; 00075 }
addItemsCount | ( | ) |
Add total count of Items for each type
Definition at line 54 of file Collection.php.
00055 { 00056 $this->getSelect() 00057 ->joinLeft( 00058 array('items'=>$this->getTable('googlebase/items')), 00059 'main_table.type_id=items.type_id', 00060 array('items_total' => 'COUNT(items.item_id)')) 00061 ->group('main_table.type_id'); 00062 return $this; 00063 }