function Entity::defineOptions

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

Overrides TokenizeAreaPluginBase::defineOptions

File

core/modules/views/src/Plugin/views/area/Entity.php, line 116

Class

Entity
Provides an area handler which renders an entity in a certain view mode.

Namespace

Drupal\views\Plugin\views\area

Code

protected function defineOptions() {
    $options = parent::defineOptions();
    // Per default we enable tokenize, as this is the most common use case for
    // this handler.
    $options['tokenize']['default'] = TRUE;
    // Contains the config target identifier for the entity.
    $options['target'] = [
        'default' => '',
    ];
    $options['view_mode'] = [
        'default' => 'default',
    ];
    $options['bypass_access'] = [
        'default' => FALSE,
    ];
    return $options;
}

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