function User::defineOptions

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

Overrides Entity::defineOptions

File

core/modules/user/src/Plugin/views/argument_validator/User.php, line 43

Class

User
Validate whether an argument is a valid user.

Namespace

Drupal\user\Plugin\views\argument_validator

Code

protected function defineOptions() {
    $options = parent::defineOptions();
    $options['restrict_roles'] = [
        'default' => FALSE,
    ];
    $options['roles'] = [
        'default' => [],
    ];
    return $options;
}

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