function EntityReference::__construct

Same name in this branch
  1. 11.x core/modules/views/src/Plugin/views/display/EntityReference.php \Drupal\views\Plugin\views\display\EntityReference::__construct()
Same name and namespace in other branches
  1. 8.9.x core/lib/Drupal/Core/Field/Plugin/migrate/field/d7/EntityReference.php \Drupal\Core\Field\Plugin\migrate\field\d7\EntityReference::__construct()
  2. 10 core/modules/views/src/Plugin/views/display/EntityReference.php \Drupal\views\Plugin\views\display\EntityReference::__construct()
  3. 9 core/modules/views/src/Plugin/views/display/EntityReference.php \Drupal\views\Plugin\views\display\EntityReference::__construct()
  4. 8.9.x core/modules/views/src/Plugin/views/display/EntityReference.php \Drupal\views\Plugin\views\display\EntityReference::__construct()
  5. main core/modules/views/src/Plugin/views/display/EntityReference.php \Drupal\views\Plugin\views\display\EntityReference::__construct()
  6. main core/modules/views/src/Plugin/views/filter/EntityReference.php \Drupal\views\Plugin\views\filter\EntityReference::__construct()

Constructs an EntityReference object.

Parameters

array $configuration: A configuration array containing information about the plugin instance.

string $plugin_id: The plugin ID for the plugin instance.

mixed $plugin_definition: The plugin implementation definition.

Overrides HandlerBase::__construct

File

core/modules/views/src/Plugin/views/filter/EntityReference.php, line 89

Class

EntityReference
Filters a view by entity references.

Namespace

Drupal\views\Plugin\views\filter

Code

public function __construct(array $configuration, $plugin_id, $plugin_definition, protected SelectionPluginManagerInterface $selectionPluginManager, protected EntityTypeManagerInterface $entityTypeManager, MessengerInterface $messenger) {
  parent::__construct($configuration, $plugin_id, $plugin_definition);
  $this->setMessenger($messenger);
  // @todo Unify 'entity field'/'field_name' instead of converting back and
  // forth. https://www.drupal.org/node/2410779
  if (isset($this->definition['entity field'])) {
    $this->definition['field_name'] = $this->definition['entity field'];
  }
}

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