How could I get Attribute model
(from: eav_attribute
table) by attribute_code
in Magento?
Notice:
– I don't care what is entity_type.
Thank you so much.
Magento – Get Attribute model by attribute_code in Magento
magento
magento
How could I get Attribute model
(from: eav_attribute
table) by attribute_code
in Magento?
Notice:
– I don't care what is entity_type.
Thank you so much.
Best Answer
You have to know
entity_type
because you can have the sameattribute_code
for different entities. So to get attribute model:$entity_type
parameter can benumeric
(id directly),string
(for example'catalog_product'
orMage_Catalog_Model_Product::ENTITY
) or it can be instance of modelMage_Eav_Model_Entity_Type