You are here

public function Node::init in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/node/src/Plugin/views/field/Node.php \Drupal\node\Plugin\views\field\Node::init()
  2. 9 core/modules/node/src/Plugin/views/field/Node.php \Drupal\node\Plugin\views\field\Node::init()
1 call to Node::init()
HistoryUserTimestamp::init in core/modules/history/src/Plugin/views/field/HistoryUserTimestamp.php
1 method overrides Node::init()
HistoryUserTimestamp::init in core/modules/history/src/Plugin/views/field/HistoryUserTimestamp.php

File

core/modules/node/src/Plugin/views/field/Node.php, line 26

Class

Node
Field handler to provide simple renderer that allows linking to a node. Definition terms:

Namespace

Drupal\node\Plugin\views\field

Code

public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) {
  parent::init($view, $display, $options);

  // Don't add the additional fields to groupby
  if (!empty($this->options['link_to_node'])) {
    $this->additional_fields['nid'] = [
      'table' => 'node_field_data',
      'field' => 'nid',
    ];
  }
}