summaryrefslogtreecommitdiffstats
path: root/core/modules/system/tests/modules/form_test/src/Form/FormTestTableSelectMultipleFalseForm.php
blob: d79b235e0f29febd0817124b11b613b64e5a5776 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php

namespace Drupal\form_test\Form;

use Drupal\Core\Form\FormStateInterface;

/**
 * Builds a form to test table select with '#multiple" set to FALSE.
 *
 * @internal
 */
class FormTestTableSelectMultipleFalseForm extends FormTestTableSelectFormBase {

  /**
   * {@inheritdoc}
   */
  public function getFormId() {
    return '_form_test_tableselect_multiple_false_form';
  }

  /**
   * {@inheritdoc}
   */
  public function buildForm(array $form, FormStateInterface $form_state) {
    return $this->tableselectFormBuilder($form, $form_state, ['#multiple' => FALSE]);
  }

  /**
   * {@inheritdoc}
   */
  public function submitForm(array &$form, FormStateInterface $form_state) {
    drupal_set_message(t('Submitted: @value', ['@value' => $form_state->getValue('tableselect')]));
  }

}