Mage_Tax_Model_Mysql4_Calculation_Rate_Collection Class Reference

Inheritance diagram for Mage_Tax_Model_Mysql4_Calculation_Rate_Collection:

Mage_Core_Model_Mysql4_Collection_Abstract Varien_Data_Collection_Db Varien_Data_Collection

List of all members.

Public Member Functions

 joinCountryTable ()
 joinRegionTable ()
 joinTitle ($store=null)
 joinStoreTitles ()
 addRateFilter ($rateId)
 toOptionArray ()
 toOptionHash ()

Protected Member Functions

 _construct ()


Detailed Description

Definition at line 35 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('tax/calculation_rate');
00040     }

addRateFilter ( rateId  ) 

Definition at line 102 of file Collection.php.

00103     {
00104         if (is_int($rateId) && $rateId > 0) {
00105             return $this->_select->where('main_table.tax_rate_id=?', $rateId);
00106         }
00107         else {
00108             return $this;
00109         }
00110     }

joinCountryTable (  ) 

Definition at line 42 of file Collection.php.

00043     {
00044         $this->_select->join(
00045             array('country_table' => $this->getTable('directory/country')),
00046             'main_table.tax_country_id=country_table.country_id',
00047             array('country_name' => 'iso2_code')
00048         );
00049         return $this;
00050     }

joinRegionTable (  ) 

Join Region Table

Returns:
object

Definition at line 57 of file Collection.php.

00058     {
00059         $this->_select->joinLeft(
00060             array('region_table' => $this->getTable('directory/country_region')),
00061             'main_table.tax_region_id=region_table.region_id',
00062             array('region_name' => 'code')
00063         );
00064         return $this;
00065     }

joinStoreTitles (  ) 

Joins store titles for rates

Returns:
object

Definition at line 89 of file Collection.php.

00090     {
00091         $storeCollection = Mage::getModel('core/store')->getCollection()->setLoadDefault(true);
00092         foreach ($storeCollection as $store) {
00093             $this->_select->joinLeft(
00094                 array('title_table_' . $store->getId() => $this->getTable('tax/tax_calculation_rate_title')),
00095                 "main_table.tax_calculation_rate_id=title_table_{$store->getId()}.tax_calculation_rate_id AND title_table_{$store->getId()}.store_id = '{$store->getId()}'",
00096                 array('title_' . $store->getId() => 'value')
00097             );
00098         }
00099         return $this;
00100     }

joinTitle ( store = null  ) 

Join rate title for specified store

Parameters:
mixed store
Returns:
object

Definition at line 73 of file Collection.php.

00074     {
00075         $storeId = Mage::app()->getStore($store)->getId();
00076         $this->_select->joinLeft(
00077             array('title_table' => $this->getTable('tax/tax_calculation_rate_title')),
00078             "main_table.tax_calculation_rate_id=title_table.tax_calculation_rate_id AND title_table.store_id = '{$storeId}'",
00079             array('title' => 'value')
00080         );
00081         return $this;
00082     }

toOptionArray (  ) 

Reimplemented from Varien_Data_Collection.

Definition at line 112 of file Collection.php.

00113     {
00114         return $this->_toOptionArray('tax_calculation_rate_id', 'code');
00115     }

toOptionHash (  ) 

Reimplemented from Varien_Data_Collection.

Definition at line 117 of file Collection.php.

00118     {
00119         return $this->_toOptionHash('tax_calculation_rate_id', 'code');
00120     }


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

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