You are here

public function StockLocationForm::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 EntityForm::buildForm

File

modules/local_storage/src/Form/StockLocationForm.php, line 18

Class

StockLocationForm
Form controller for stock location edit forms.

Namespace

Drupal\commerce_stock_local\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {

  /* @var $entity \Drupal\commerce_stock_local\Entity\StockLocation */
  $form = parent::buildForm($form, $form_state);
  $form['status'] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Active'),
    '#default_value' => $this->entity
      ->isActive(),
    '#weight' => 99,
  ];
  return $form;
}