/** * Adding attribute to entity * * @param Mage_Eav_Model_Entity_Attribute_Abstract $attribute * @return Mage_Eav_Model_Entity_Abstract */ public function addAttribute(Mage_Eav_Model_Entity_Attribute_Abstract $attribute) { $attribute->setEntity($this); $attributeCode = $attribute->getAttributeCode(); $this->_attributesByCode[$attributeCode] = $attribute; if ($attribute->isStatic()) { $this->_staticAttributes[$attributeCode] = $attribute; } else { $this->_attributesById[$attribute->getId()] = $attribute; $this->_attributesByTable[$attribute->getBackendTable()][$attributeCode] = $attribute; } return $this; }