See the edit please
I'm doing this:
/* @var $attributeModel Mage_Catalog_Model_Entity_Attribute */ $attributeModel = Mage::getModel('catalog/entity_attribute'); $attributeModel->setEntityTypeId($entityTypeId); $attributeModel->setAttributeCode($propName); $attributeModel->setBackendType('varchar'); $attributeModel->setName($propName); $description = $this->attributes[$propName]; $attributeModel->setFrontendLabel($description); $attributeModel->save();
and I'm getting this nasty error whose origin I can't figure out:
Fatal error: Call to undefined method Mage_Eav_Model_Resource_Entity_Attribute::isUsedBySuperProducts() in /var/www/html/app/code/core/Mage/Catalog/Model/Entity/Attribute.php on line 86
So apparently, this function does not exist. Well, I saw it and my IDE even found it with code completion, so it definitely exists. What could this be?
Maybe I'm missing something while creating the attribute? Can't guess what though, I'm really stuck...
EDIT: Okay, I was using the model
catalog/entity_attribute, but I'm supposed to use
catalog/resource_eav_attribute, then it works.
Well, why do I have to use a resource there, though? Shouldn't a model be able to create the attribute and use the resource rather than me using the resource directly? Is it me or is this not really consequent behavior? I don't get it