Mage_Eav_Model_Convert_Parser_Abstract Class Reference

Inheritance diagram for Mage_Eav_Model_Convert_Parser_Abstract:

Mage_Dataflow_Model_Convert_Parser_Abstract Mage_Dataflow_Model_Convert_Container_Abstract Mage_Dataflow_Model_Convert_Parser_Interface Mage_Dataflow_Model_Convert_Container_Interface Mage_Catalog_Model_Convert_Parser_Product Mage_Customer_Model_Convert_Parser_Customer

List of all members.

Public Member Functions

 getStoreIds ($stores)
 getStoreCode ($storeId)
 loadAttributeSets ($entityTypeId)
 getAttributeSetName ($entityTypeId, $id)
 getAttributeSetId ($entityTypeId, $name)
 getSourceOptionId (Mage_Eav_Model_Entity_Attribute_Source_Interface $source, $value)

Protected Attributes

 $_storesById
 $_attributeSetsById
 $_attributeSetsByName


Detailed Description

Definition at line 28 of file Abstract.php.


Member Function Documentation

getAttributeSetId ( entityTypeId,
name 
)

Definition at line 84 of file Abstract.php.

00085     {
00086         if (!$this->_attributeSetsByName) {
00087             $this->loadAttributeSets($entityTypeId);
00088         }
00089         return isset($this->_attributeSetsByName[$name]) ? $this->_attributeSetsByName[$name] : false;
00090     }

getAttributeSetName ( entityTypeId,
id 
)

Definition at line 76 of file Abstract.php.

00077     {
00078         if (!$this->_attributeSetsById) {
00079             $this->loadAttributeSets($entityTypeId);
00080         }
00081         return isset($this->_attributeSetsById[$id]) ? $this->_attributeSetsById[$id] : false;
00082     }

getSourceOptionId ( Mage_Eav_Model_Entity_Attribute_Source_Interface source,
value 
)

Definition at line 92 of file Abstract.php.

00093     {
00094         foreach ($source->getAllOptions() as $option) {
00095             if (strcasecmp($option['label'], $value)==0) {
00096                 return $option['value'];
00097             }
00098         }
00099         return null;
00100     }

getStoreCode ( storeId  ) 

Definition at line 56 of file Abstract.php.

00057     {
00058         return Mage::app()->getStore($storeId?$storeId:0)->getCode();
00059     }

getStoreIds ( stores  ) 

Definition at line 35 of file Abstract.php.

00036     {
00037        if (empty($stores)) {
00038             $storeIds = array(0);
00039         } else {
00040             $storeIds = array();
00041             foreach (explode(',', $stores) as $store) {
00042                 if (is_numeric($store)) {
00043                     $storeIds[] = $store;
00044                 } else {
00045                     $storeNode = Mage::getConfig()->getNode('stores/'.$store);
00046                     if (!$storeNode) {
00047                         return false;
00048                     }
00049                     $storeIds[] = (int)$storeNode->system->store->id;
00050                 }
00051             }
00052         }
00053         return $storeIds;
00054     }

loadAttributeSets ( entityTypeId  ) 

Definition at line 61 of file Abstract.php.

00062     {
00063         $attributeSetCollection = Mage::getResourceModel('eav/entity_attribute_set_collection')
00064             ->setEntityTypeFilter($entityTypeId)
00065             ->load();
00066         $this->_attributeSetsById = array();
00067         $this->_attributeSetsByName = array();
00068         foreach ($attributeSetCollection as $id=>$attributeSet) {
00069             $name = $attributeSet->getAttributeSetName();
00070             $this->_attributeSetsById[$id] = $name;
00071             $this->_attributeSetsByName[$name] = $id;
00072         }
00073         return $this;
00074     }


Member Data Documentation

$_attributeSetsById [protected]

Definition at line 32 of file Abstract.php.

$_attributeSetsByName [protected]

Definition at line 33 of file Abstract.php.

$_storesById [protected]

Definition at line 31 of file Abstract.php.


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

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