as far as I understand when you have a <source_model> in your system.xml, it searches through the specified module for the function of getOptionArray(), right now I need to show all the attribute set names in a multi-select in the system configuration and was wondering why getoptionarray does not exist for the eav/entity_attribute_set? does it exist somewhere else which I am not aware of?

<show_attributesetname translate="label">

I was wondering if it exists and I just could not find it. if it doesn't exist then I should go ahead and add a tooptionarray to my module.

wanted to know if it really does not exist?? since doesn't seem right to me.

2 Answers 2


Yes we do have it, after Kul answered no and came up with toOptionArray, I searched again this time with toOptionArray and found out, we do have the source model for it in the resurces.

here is the answer:


I'm not sure if my solution is cool enough since I am using resource in source! would love to hear back if anybody thinks what I did is wrong.


No. As far i know there is not any source model to get attribute set. You can create your own source model and add below code to fetch attribute set.

public function toOptionArray()
        if (!count($this->_options)) {
            $entityTypeId           = Mage::getResourceModel('catalog/product')->getTypeId();
            $attributeSetCollection = Mage::getResourceModel('eav/entity_attribute_set_collection')

            foreach ($attributeSetCollection as $_attributeSet) {
                $this->_options[] = array(
                    'value' => $_attributeSet->getId(),
                    'label' => $_attributeSet->getAttributeSetName()
        return $this->_options;

Hope this help!

  • shouldn't your function be getOptionArray?
    – Nickool
    Nov 1, 2016 at 22:04
  • nevermind seems both works
    – Nickool
    Nov 1, 2016 at 22:06
  • you helped me to find my answer, I will upvote and then post the answer, the answer is yes we can do it. I searched for toOptionArray and found it for arrtibutesetnames
    – Nickool
    Nov 1, 2016 at 22:10
  • @Nickool Perfect I wasn't 100% sure That's why i Mention as far as i know. Glad to know you found proper solution.
    – Kul
    Nov 1, 2016 at 22:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.