getEavImageAttributesCollection(); /** @var $attribute Mage_Eav_Model_Entity_Attribute */ foreach($collection as $attribute) { $options[] = array( 'value'=> $attribute->getAttributeCode(), 'label'=> $attribute->getFrontendLabel(), ); } return $options; } /** * @param bool $allAttributes * @return Mage_Eav_Model_Resource_Entity_Attribute_Collection */ public function getEavImageAttributesCollection($allAttributes = true) { if ($allAttributes) { $attributes = $this->_getHelper()->getAttributes(); } else { $attributes = $this->_getHelper()->getAllowedAttributes(); } $collection = $this->_getEavCollection(); $collection->addFieldToFilter('attribute_code', array('in' => $attributes)); $collection->addFieldToFilter('entity_type_id', $this->_getEntityTypeId()); return $collection; } /** * @return Lanot_EasySticker_Helper_Data */ protected function _getHelper() { return Mage::helper('lanot_easysticker'); } /** * @return Mage_Eav_Model_Resource_Entity_Attribute_Collection */ protected function _getEavCollection() { return Mage::getResourceModel('eav/entity_attribute_collection'); } /** * @return int */ protected function _getEntityTypeId() { return (int) Mage::getModel('eav/entity_type')->load('catalog_product', 'entity_type_code')->getId(); } }