function Entity::submitOptionsForm

Same name in this branch
  1. 11.x core/modules/views/src/Plugin/views/area/Entity.php \Drupal\views\Plugin\views\area\Entity::submitOptionsForm()
Same name in other branches
  1. 9 core/modules/views/src/Plugin/views/argument_validator/Entity.php \Drupal\views\Plugin\views\argument_validator\Entity::submitOptionsForm()
  2. 9 core/modules/views/src/Plugin/views/area/Entity.php \Drupal\views\Plugin\views\area\Entity::submitOptionsForm()
  3. 8.9.x core/modules/views/src/Plugin/views/argument_validator/Entity.php \Drupal\views\Plugin\views\argument_validator\Entity::submitOptionsForm()
  4. 8.9.x core/modules/views/src/Plugin/views/area/Entity.php \Drupal\views\Plugin\views\area\Entity::submitOptionsForm()
  5. 10 core/modules/views/src/Plugin/views/argument_validator/Entity.php \Drupal\views\Plugin\views\argument_validator\Entity::submitOptionsForm()
  6. 10 core/modules/views/src/Plugin/views/area/Entity.php \Drupal\views\Plugin\views\area\Entity::submitOptionsForm()

Overrides ArgumentValidatorPluginBase::submitOptionsForm

1 method overrides Entity::submitOptionsForm()
User::submitOptionsForm in core/modules/user/src/Plugin/views/argument_validator/User.php
Provides the default form for submitting options.

File

core/modules/views/src/Plugin/views/argument_validator/Entity.php, line 160

Class

Entity
Defines an argument validator plugin for each entity type.

Namespace

Drupal\views\Plugin\views\argument_validator

Code

public function submitOptionsForm(&$form, FormStateInterface $form_state, &$options = []) {
    // Filter out unused options so we don't store giant unnecessary arrays.
    // Note that the bundles form option doesn't appear on the form if the
    // entity type doesn't support bundles, so the option may not be set.
    if (!empty($options['bundles'])) {
        $options['bundles'] = array_filter($options['bundles']);
    }
    else {
        // Set bundles back to its default empty value.
        $options['bundles'] = [];
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.