//Mage_Eav_Model_Mysql4_Entity_Attribute_Collection
Mage::getResourceModel('eav/entity_attribute_collection')->setEntityTypeFilter(Mage_Catalog_Model_Product::ENTITY);
should do.
We just found a bug, you have to pass the entity_type_id:
$col = Mage::getResourceModel('eav/entity_attribute_collection')->setEntityTypeFilter(4);
DOES
The code is the documentation:
if ($type instanceof Mage_Eav_Model_Entity_Type) {
$additionalTable = $type->getAdditionalAttributeTable();
$id = $type->getId();
} else {
$additionalTable = $this->getResource()->getAdditionalAttributeTable($type);
$id = $type;
}
hopefully working solution (updated by @Alex comment)
You have to pass a Mage_Eav_Model_Entity_Type
so this should work and is not hardcoded:
$type = Mage::getModel('eav/entity_type')->loadByCode(Mage_Catalog_Model_Product::ENTITY)
Mage::getResourceModel('eav/entity_attribute_collection')->setEntityTypeFilter($type);