Mage_GoogleBase_Model_Mysql4_Type_Collection Class Reference

Inheritance diagram for Mage_GoogleBase_Model_Mysql4_Type_Collection:

Mage_Core_Model_Mysql4_Collection_Abstract Varien_Data_Collection_Db Varien_Data_Collection

List of all members.

Public Member Functions

 addItemsCount ()
 addCountryFilter ($iso)

Protected Member Functions

 _construct ()
 _initSelect ()
 _joinAttributeSet ()


Detailed Description

Definition at line 34 of file Collection.php.


Member Function Documentation

_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

Returns:
Mage_GoogleBase_Model_Mysql4_Type_Collection

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

Parameters:
string $iso Two-letter country ISO code
Returns:
Mage_GoogleBase_Model_Mysql4_Type_Collection

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

Returns:
Mage_GoogleBase_Model_Mysql4_Type_Collection

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     }


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

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