Mage_CatalogIndex_Model_Retreiver Class Reference

Inheritance diagram for Mage_CatalogIndex_Model_Retreiver:

Mage_Core_Model_Abstract Varien_Object

List of all members.

Public Member Functions

 getRetreiver ($type)
 getCustomerGroups ()
 assignProductTypes ($products)

Public Attributes

const CHILDREN_FOR_TIERS = 1
const CHILDREN_FOR_PRICES = 2
const CHILDREN_FOR_ATTRIBUTES = 3

Protected Member Functions

 _construct ()

Protected Attributes

 $_attributeIdCache = array()
 $_customerGroups
 $_retreivers = array()


Detailed Description

Index data retreiver factory

Author:
Magento Core Team <core@magentocommerce.com>

Definition at line 32 of file Retreiver.php.


Member Function Documentation

_construct (  )  [protected]

Retreiver factory init, load retreiver settings

Reimplemented from Varien_Object.

Definition at line 58 of file Retreiver.php.

00059     {
00060         $config = Mage::getConfig()->getNode('global/catalog/product/type')->asArray();
00061         foreach ($config as $type=>$data) {
00062             if (isset($data['index_data_retreiver'])) {
00063                 $this->_retreivers[$type] = $data['index_data_retreiver'];
00064             }
00065         }
00066 
00067         $this->_init('catalogindex/retreiver');
00068     }

assignProductTypes ( products  ) 

Return product ids sorted by type

Parameters:
array $products
Returns:
array

Definition at line 104 of file Retreiver.php.

00105     {
00106         $flat = $this->_getResource()->getProductTypes($products);
00107         $result = array();
00108         foreach ($flat as $one) {
00109             $result[$one['type']][] = $one['id'];
00110         }
00111         return $result;
00112     }

getCustomerGroups (  ) 

Return customer group collection

Returns:
Mage_Customer_Model_Entity_Group_Collection

Definition at line 90 of file Retreiver.php.

00091     {
00092         if (is_null($this->_customerGroups)) {
00093             $this->_customerGroups = Mage::getModel('customer/group')->getCollection();
00094         }
00095         return $this->_customerGroups;
00096     }

getRetreiver ( type  ) 

Returns data retreiver model by specified product type

Parameters:
string $type
Returns:
Mage_CatalogIndex_Model_Data_Abstract

Definition at line 76 of file Retreiver.php.

00077     {
00078         if (isset($this->_retreivers[$type])) {
00079             return Mage::getSingleton($this->_retreivers[$type]);
00080         } else {
00081             Mage::throwException("Data retreiver for '{$type}' is not defined");
00082         }
00083     }


Member Data Documentation

$_attributeIdCache = array() [protected]

Definition at line 38 of file Retreiver.php.

$_customerGroups [protected]

Definition at line 45 of file Retreiver.php.

$_retreivers = array() [protected]

Definition at line 52 of file Retreiver.php.

Definition at line 36 of file Retreiver.php.

Definition at line 35 of file Retreiver.php.

const CHILDREN_FOR_TIERS = 1

Definition at line 34 of file Retreiver.php.


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

Generated on Sat Jul 4 17:23:47 2009 for Magento by  doxygen 1.5.8