You are here

public function Bundle::init in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/views/src/Plugin/views/filter/Bundle.php \Drupal\views\Plugin\views\filter\Bundle::init()

Overrides \Drupal\views\Plugin\views\HandlerBase::init().

Provide some extra help to get the operator/value easier to use.

This likely has to be overridden by filters which are more complex than simple operator/value.

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');
}