src/Magento/Helpers/FormMapper.php
protected function getMagentoProperty($key, $value, $type)
    {
        switch ($key) {
            // Fields to ignore:
            case 'type':
            case 'id':
            case 'fields':
                $result = array();
                break;
            case 'summary':
                $result = array('legend' => $value);
                break;
            // Fields to return unchanged:
            case 'legend':
            case 'label':
            case 'format':
                $result = array($key => $value);
                break;
            case 'name':
                if ($type === 'checkbox') {
                    // Make it an array for PHP POST processing, in case there
                    // are multiple checkboxes.
                    $value .= '[]';
                }
                $result = array($key => $value);
                break;
            case 'description':
                // The description of a fieldset is handled elsewhere.
                $result = $type !== 'fieldset' ? array('after_element_html' => '<p class="note">' . $value . '</p>') : array();
                break;
            case 'value':
                if ($type === 'markup') {
                    $result = array('text' => $value);
                } else { // $type === 'hidden'
                    $result = array('value' => $value);
                }
                break;
            case 'attributes':
                // In magento you add pure html attributes at the same level as
                // the "field attributes" that are for Magento.
                $result = $value;
                if (!empty($value['required'])) {
                    if (isset($result['class'])) {
                        $result['class'] .= ' ';
                    } else {
                        $result['class'] = '';
                    }
                    if ($type === 'radio') {
                        unset($result['required']);
                        $result['class'] .= 'validate-one-required-by-name';
                    } else {
                        $result['class'] .= 'required-entry';
                    }
                }
                break;
            case 'options':
                $result = array('values' => $this->getMagentoOptions($value));
                break;
            default:
                $this->log->warning(__METHOD__ . "Unknown key '$key'");
                $result = array($key => $value);
                break;
        }
        return $result;
    }
protected function getMagentoProperty($key, $value, $type)
    {
        switch ($key) {
            // Fields to ignore:
            case 'type':
            case 'id':
            case 'fields':
                $result = array();
                break;
            case 'summary':
                $result = array('legend' => $value);
                break;
            // Fields to return unchanged:
            case 'legend':
            case 'label':
            case 'format':
                $result = array($key => $value);
                break;
            case 'name':
                if ($type === 'checkbox') {
                    // Make it an array for PHP POST processing, in case there
                    // are multiple checkboxes.
                    $value .= '[]';
                }
                $result = array($key => $value);
                break;
            case 'description':
                // The description of a fieldset is handled elsewhere.
                $result = $type !== 'fieldset' ? array('after_element_html' => '<p class="note">' . $value . '</p>') : array();
                break;
            case 'value':
                if ($type === 'markup') {
                    $result = array('text' => $value);
                } else { // $type === 'hidden'
                    $result = array('value' => $value);
                }
                break;
            case 'attributes':
                // In magento you add pure html attributes at the same level as
                // the "field attributes" that are for Magento.
                $result = $value;
                if (!empty($value['required'])) {
                    if (isset($result['class'])) {
                        $result['class'] .= ' ';
                    } else {
                        $result['class'] = '';
                    }
                    if ($type === 'radio') {
                        unset($result['required']);
                        $result['class'] .= 'validate-one-required-by-name';
                    } else {
                        $result['class'] .= 'required-entry';
                    }
                }
                break;
            case 'options':
                $result = array('values' => $this->getMagentoOptions($value));
                break;
            default:
                $this->log->warning(__METHOD__ . "Unknown key '$key'");
                $result = array($key => $value);
                break;
        }
        return $result;
    }
protected function getMagentoProperty ( $ key , $ value , $ type ) { switch ( $ key ) { // Fields to ignore: case 'type' : case 'id' : case 'fields' : $ result = array ( ) ; break ; case 'summary' : $ result = array ( 'legend' => $ value ) ; break ; // Fields to return unchanged: case 'legend' : case 'label' : case 'format' : $ result = array ( $ key => $ value ) ; break ; case 'name' : if ( $ type === 'checkbox' ) { // Make it an array for PHP POST processing, in case there // are multiple checkboxes. $ value .= '[]' ; } $ result = array ( $ key => $ value ) ; break ; case 'description' : // The description of a fieldset is handled elsewhere. $ result = $ type !== 'fieldset' ? array ( 'after_element_html' => '<p class="note">' . $ value . '</p>' ) : array ( ) ; break ; case 'value' : if ( $ type === 'markup' ) { $ result = array ( 'text' => $ value ) ; } else { // $type === 'hidden' $ result = array ( 'value' => $ value ) ; } break ; case 'attributes' : // In magento you add pure html attributes at the same level as // the "field attributes" that are for Magento. $ result = $ value ; if ( ! empty ( $ value [ 'required' ] ) ) { if ( isset ( $ result [ 'class' ] ) ) { $ result [ 'class' ] .= ' ' ; } else { $ result [ 'class' ] = '' ; } if ( $ type === 'radio' ) { unset ( $ result [ 'required' ] ) ; $ result [ 'class' ] .= 'validate-one-required-by-name' ; } else { $ result [ 'class' ] .= 'required-entry' ; } } break ; case 'options' : $ result = array ( 'values' => $ this -> getMagentoOptions ( $ value ) ) ; break ; default : $ this -> log -> warning ( __METHOD__ . "Unknown key '$key'" ) ; $ result = array ( $ key => $ value ) ; break ; } return $ result ; }
Converts an Acumulus settings to a Magento setting.

@param string $key
The name of the setting to convert.
@param mixed $value
The value for the setting to convert.
@param string $type
The Acumulus field type.

@return array
The Magento setting. This will typically contain 1 element, but in some
cases 1 Acumulus field setting may result in multiple Magento settings.
Converts an Acumulus settings to a Magento setting .