public function NodeNewComments::init

Overrides Drupal\views\Plugin\views\field\FieldPluginBase::init().

Overrides FieldPluginBase::init

File

drupal/core/modules/comment/lib/Drupal/comment/Plugin/views/field/NodeNewComments.php, line 27
Definition of Drupal\comment\Plugin\views\field\NodeNewComments.

Class

NodeNewComments
Field handler to display the number of new comments.

Namespace

Drupal\comment\Plugin\views\field

Code

public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) {
  parent::init($view, $display, $options);
  $this->additional_fields['nid'] = 'nid';
  $this->additional_fields['type'] = 'type';
  $this->additional_fields['comment_count'] = array(
    'table' => 'node_comment_statistics',
    'field' => 'comment_count',
  );
}