You are here

protected function MappingTest::defineMapping in Views (for Drupal 7) 8.3

Overrides Drupal\views\Plugin\views\style\Mapping::defineMapping().

Overrides Mapping::defineMapping

File

tests/views_test_data/lib/Drupal/views_test_data/Plugin/views/style/MappingTest.php, line 33
Definition of Drupal\views_test_data\Plugin\views\style\MappingTest;

Class

MappingTest
Provides a test plugin for the mapping style.

Namespace

Drupal\views_test_data\Plugin\views\style

Code

protected function defineMapping() {
  return array(
    'title_field' => array(
      '#title' => t('Title field'),
      '#description' => t('Choose the field with the custom title.'),
      '#toggle' => TRUE,
      '#required' => TRUE,
    ),
    'name_field' => array(
      '#title' => t('Name field'),
      '#description' => t('Choose the field with the custom name.'),
    ),
    'numeric_field' => array(
      '#title' => t('Numeric field'),
      '#description' => t('Select one or more numeric fields.'),
      '#multiple' => TRUE,
      '#toggle' => TRUE,
      '#filter' => 'filterNumericFields',
      '#required' => TRUE,
    ),
  );
}