Mage_GoogleBase_Model_Mysql4_Attribute_Collection Class Reference

Inheritance diagram for Mage_GoogleBase_Model_Mysql4_Attribute_Collection:

Mage_Core_Model_Mysql4_Collection_Abstract Varien_Data_Collection_Db Varien_Data_Collection

List of all members.

Public Member Functions

 addAttributeSetFilter ($attributeSetId, $targetCountry)
 addTypeFilter ($type_id)
 load ($printQuery=false, $logQuery=false)
 getJoinAttributeSetFlag ()
 setJoinAttributeSetFlag ($flag)

Protected Member Functions

 _construct ()
 _joinAttributeSet ()

Protected Attributes

 $_joinAttributeSetFlag = true


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 42 of file Collection.php.

00043     {
00044         $this->_init('googlebase/attribute');
00045     }

_joinAttributeSet (  )  [protected]

Definition at line 75 of file Collection.php.

00076     {
00077         $this->getSelect()
00078             ->joinInner(
00079                 array('types'=>$this->getTable('googlebase/types')),
00080                 'main_table.type_id=types.type_id',
00081                 array('attribute_set_id' => 'types.attribute_set_id', 'target_country' => 'types.target_country'));
00082         return $this;
00083     }

addAttributeSetFilter ( attributeSetId,
targetCountry 
)

Definition at line 47 of file Collection.php.

00048     {
00049         if (!$this->getJoinAttributeSetFlag()) {
00050             return $this;
00051         }
00052         $this->getSelect()->where('attribute_set_id = ?', $attributeSetId);
00053         $this->getSelect()->where('target_country = ?', $targetCountry);
00054         return $this;
00055     }

addTypeFilter ( type_id  ) 

Definition at line 57 of file Collection.php.

00058     {
00059         $this->getSelect()->where('main_table.type_id = ?', $type_id);
00060         return $this;
00061     }

getJoinAttributeSetFlag (  ) 

Definition at line 85 of file Collection.php.

00086     {
00087         return $this->_joinAttributeSetFlag;
00088     }

load ( printQuery = false,
logQuery = false 
)

Load data

Returns:
Varien_Data_Collection_Db

Reimplemented from Mage_Core_Model_Mysql4_Collection_Abstract.

Definition at line 63 of file Collection.php.

00064     {
00065         if ($this->isLoaded()) {
00066             return $this;
00067         }
00068         if ($this->getJoinAttributeSetFlag()) {
00069             $this->_joinAttributeSet();
00070         }
00071         parent::load($printQuery, $logQuery);
00072         return $this;
00073     }

setJoinAttributeSetFlag ( flag  ) 

Definition at line 90 of file Collection.php.

00091     {
00092         return $this->_joinAttributeSetFlag = (bool)$flag;
00093     }


Member Data Documentation

$_joinAttributeSetFlag = true [protected]

Whether to join attribute_set_id to attributes or not

Definition at line 39 of file Collection.php.


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