You are here

protected function PaymentMethodAddForm::buildPurchaseOrderForm in Commerce Purchase Order 8

Builds the purchase order form.

Parameters

array $element: The target element.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the complete form.

Return value

array The built form.

1 call to PaymentMethodAddForm::buildPurchaseOrderForm()
PaymentMethodAddForm::buildConfigurationForm in src/PluginForm/PurchaseOrder/PaymentMethodAddForm.php
Form constructor.

File

src/PluginForm/PurchaseOrder/PaymentMethodAddForm.php, line 74

Class

PaymentMethodAddForm
PaymentMethodAddForm for Purchase Order.

Namespace

Drupal\commerce_purchase_order\PluginForm\PurchaseOrder

Code

protected function buildPurchaseOrderForm(array $element, FormStateInterface $form_state) {
  $element['#attributes']['class'][] = 'purchase-order-form';
  $element['number'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('Purchase Order number'),
    '#attributes' => [
      'autocomplete' => 'off',
    ],
    '#required' => TRUE,
    '#maxlength' => 19,
    '#size' => 20,
  ];
  return $element;
}