src/Shop/ConfigForm.php
protected function getPaymentMethodsFieldset(array $paymentMethods, $key, array $options)
    {
        $fieldset = array(
            'type' => 'fieldset',
            'legend' => $this->t("{$key}Fieldset"),
            'description' => $this->t("desc_{$key}Fieldset"),
            'fields' => array(),
        );

        $options[0] = $this->t('option_use_default');
        foreach ($paymentMethods as $paymentMethodId => $paymentMethodLabel) {
            $fieldset['fields']["{$key}[{$paymentMethodId}]"] = array(
                'type' => 'select',
                'label' => $paymentMethodLabel,
                'options' => $options,
            );
        }
        return $fieldset;
    }
protected function getPaymentMethodsFieldset(array $paymentMethods, $key, array $options)
    {
        $fieldset = array(
            'type' => 'fieldset',
            'legend' => $this->t("{$key}Fieldset"),
            'description' => $this->t("desc_{$key}Fieldset"),
            'fields' => array(),
        );

        $options[0] = $this->t('option_use_default');
        foreach ($paymentMethods as $paymentMethodId => $paymentMethodLabel) {
            $fieldset['fields']["{$key}[{$paymentMethodId}]"] = array(
                'type' => 'select',
                'label' => $paymentMethodLabel,
                'options' => $options,
            );
        }
        return $fieldset;
    }
protected function getPaymentMethodsFieldset ( array $ paymentMethods , $ key , array $ options ) { $ fieldset = array ( 'type' => 'fieldset' , 'legend' => $ this -> t ( "{$key}Fieldset" ) , 'description' => $ this -> t ( "desc_{$key}Fieldset" ) , 'fields' => array ( ) , ) ; $ options [ 0 ] = $ this -> t ( 'option_use_default' ) ; foreach ( $ paymentMethods as $ paymentMethodId => $ paymentMethodLabel ) { $ fieldset [ 'fields' ] [ "{$key}[{$paymentMethodId}]" ] = array ( 'type' => 'select' , 'label' => $ paymentMethodLabel , 'options' => $ options , ) ; } return $ fieldset ; }
Returns a fieldset with a select per payment method.

@param array $paymentMethods
Array of payment methods (id => label)
@param string $key
Prefix of the keys to use for the different ids.
@param array $options
Options for all the selects.

@return array
The fieldset definition.
Returns a fieldset with a select per payment method .