/** * Enter description here... * * @return array */ public function getMediaAttributes() { $attributeCollection = new Varien_Data_Collection(); $attribute1 = new Varien_Object(); $attribute1->setAttributeCode('attribute1'); $attribute1->setLabel('attribute1'); $attributeCollection->addItem($attribute1); $attribute2 = new Varien_Object(); $attribute2->setAttributeCode('attribute2'); $attribute2->setLabel('attribute2'); //$attributeCollection->addItem($attribute2); return $attributeCollection; //$this->getElement()->getDataObject()->getMediaAttributes(); }
/** * Add a field to the form or fieldset * Form and fieldset have same abstract * * @param Varien_Data_Form|Varien_Data_Form_Element_Fieldset $formOrFieldset * @param string $elementName * @param array $options * @param string $type * @return Varien_Data_Form_Element_Abstract */ protected function _addField($formOrFieldset, $elementName, $options = array(), $type = 'text') { $options = array_merge($options, array('name' => $elementName, 'label' => $this->getFieldLabel($elementName), 'note' => $this->getFieldComment($elementName), 'disabled' => $this->_isReadOnly)); if (in_array($elementName, array('period_unit', 'period_frequency', 'description'))) { $options['required'] = true; } $attribute = new Varien_Object(); $attribute->setAttributeCode($elementName); return $formOrFieldset->addField($elementName, $type, $options)->setEntityAttribute($attribute); }