Public Member Functions | |
getPrefixes () |
Definition at line 35 of file Image.php.
getPrefixes | ( | ) |
Get fields prefixes
Definition at line 43 of file Image.php.
00044 { 00045 //$entityType = Mage::getModel('eav/entity_type'); 00046 /* @var $entityType Mage_Eav_Model_Entity_Type */ 00047 //$entityTypeId = $entityType->loadByCode('catalog_product')->getEntityTypeId(); 00048 00049 // use cached eav config 00050 $entityTypeId = Mage::getSingleton('eav/config')->getEntityType('catalog_product')->getId(); 00051 00052 $collection = Mage::getModel('eav/entity_attribute')->getCollection(); 00053 /* @var $collection Mage_Eav_Model_Mysql4_Entity_Attribute_Collection */ 00054 $collection->setEntityTypeFilter($entityTypeId); 00055 $collection->setFrontendInputTypeFilter('media_image'); 00056 00057 $prefixes = array(); 00058 00059 foreach ($collection as $attribute) { 00060 /* @var $attribute Mage_Eav_Model_Entity_Attribute */ 00061 $prefixes[] = array( 00062 'field' => $attribute->getAttributeCode() . '_', 00063 'label' => $attribute->getFrontend()->getLabel(), 00064 ); 00065 } 00066 00067 return $prefixes; 00068 }