function HistoryUserTimestamp::init
Overrides Node::init
File
- 
              core/modules/ history/ src/ Plugin/ views/ field/ HistoryUserTimestamp.php, line 33 
Class
- HistoryUserTimestamp
- Field handler to display the marker for new content.
Namespace
Drupal\history\Plugin\views\fieldCode
public function init(ViewExecutable $view, DisplayPluginBase $display, ?array &$options = NULL) {
  parent::init($view, $display, $options);
  if (\Drupal::currentUser()->isAuthenticated()) {
    $this->additional_fields['created'] = [
      'table' => 'node_field_data',
      'field' => 'created',
    ];
    $this->additional_fields['changed'] = [
      'table' => 'node_field_data',
      'field' => 'changed',
    ];
    if (\Drupal::moduleHandler()->moduleExists('comment') && !empty($this->options['comments'])) {
      $this->additional_fields['last_comment'] = [
        'table' => 'comment_entity_statistics',
        'field' => 'last_comment_timestamp',
      ];
    }
  }
}Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.
