function Bundle::init

Same name and namespace in other branches
  1. 8.9.x core/modules/views/src/Plugin/views/filter/Bundle.php \Drupal\views\Plugin\views\filter\Bundle::init()
  2. 10 core/modules/views/src/Plugin/views/filter/Bundle.php \Drupal\views\Plugin\views\filter\Bundle::init()
  3. 11.x core/modules/views/src/Plugin/views/filter/Bundle.php \Drupal\views\Plugin\views\filter\Bundle::init()

Overrides InOperator::init

File

core/modules/views/src/Plugin/views/filter/Bundle.php, line 85

Class

Bundle
Filter class which allows filtering by entity bundles.

Namespace

Drupal\views\Plugin\views\filter

Code

public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) {
    parent::init($view, $display, $options);
    $this->entityTypeId = $this->getEntityType();
    $this->entityType = \Drupal::entityTypeManager()->getDefinition($this->entityTypeId);
    $this->real_field = $this->entityType
        ->getKey('bundle');
}

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