public function filterAttributeCollection(Mage_Eav_Model_Resource_Entity_Attribute_Collection $collection) { foreach (parent::filterAttributeCollection($collection) as $attribute) { if (!empty($this->_attributeOverrides[$attribute->getAttributeCode()])) { $data = $this->_attributeOverrides[$attribute->getAttributeCode()]; if (isset($data['options_method']) && method_exists($this, $data['options_method'])) { $data['filter_options'] = $this->{$data['options_method']}(); } $attribute->addData($data); } } return $collection; }
/** * Test for method filterAttributeCollection() */ public function testFilterAttributeCollection() { /** @var $collection Mage_Customer_Model_Resource_Attribute_Collection */ $collection = $this->_model->getAttributeCollection(); $collection = $this->_model->filterAttributeCollection($collection); /** * Check that disabled attributes is not existed in attribute collection */ $existedAttributes = array(); /** @var $attribute Mage_Customer_Model_Attribute */ foreach ($collection as $attribute) { $existedAttributes[] = $attribute->getAttributeCode(); } }