function NodeNewComments::init
Same name in other branches
- 8.9.x core/modules/comment/src/Plugin/views/field/NodeNewComments.php \Drupal\comment\Plugin\views\field\NodeNewComments::init()
- 10 core/modules/comment/src/Plugin/views/field/NodeNewComments.php \Drupal\comment\Plugin\views\field\NodeNewComments::init()
- 11.x core/modules/comment/src/Plugin/views/field/NodeNewComments.php \Drupal\comment\Plugin\views\field\NodeNewComments::init()
Overrides FieldPluginBase::init
File
-
core/
modules/ comment/ src/ Plugin/ views/ field/ NodeNewComments.php, line 94
Class
- NodeNewComments
- Field handler to display the number of new comments.
Namespace
Drupal\comment\Plugin\views\fieldCode
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'] = [
'table' => 'comment_entity_statistics',
'field' => 'comment_count',
];
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.