You are here

public function NodeNewComments::init in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/comment/src/Plugin/views/field/NodeNewComments.php \Drupal\comment\Plugin\views\field\NodeNewComments::init()

Initialize the plugin.

Parameters

\Drupal\views\ViewExecutable $view: The view object.

\Drupal\views\Plugin\views\display\DisplayPluginBase $display: The display handler.

array $options: The options configured for this plugin.

Overrides FieldPluginBase::init

File

core/modules/comment/src/Plugin/views/field/NodeNewComments.php, line 70
Contains \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['entity_id'] = 'nid';
  $this->additional_fields['type'] = 'type';
  $this->additional_fields['comment_count'] = array(
    'table' => 'comment_entity_statistics',
    'field' => 'comment_count',
  );
}