You are here

public function StockTransactions1::buildForm in Commerce Stock 8

Form constructor.

Parameters

array $form: An associative array containing the structure of the form.

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

Return value

array The form structure.

Overrides FormInterface::buildForm

File

modules/ui/src/Form/StockTransactions1.php, line 25

Class

StockTransactions1
The first part of a two part create stock transaction form.

Namespace

Drupal\commerce_stock_ui\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $form['product_variation'] = [
    '#type' => 'entity_autocomplete',
    '#title' => $this
      ->t('Select product variation'),
    '#target_type' => 'commerce_product_variation',
    '#required' => TRUE,
    '#selection_handler' => 'default',
  ];
  $form['submit'] = [
    '#type' => 'submit',
    '#value' => $this
      ->t('Submit'),
  ];
  return $form;
}