You are here

NodeCounterTimestamp.php in Drupal 10

File

core/modules/statistics/src/Plugin/views/field/NodeCounterTimestamp.php
View source
<?php

namespace Drupal\statistics\Plugin\views\field;

use Drupal\views\Plugin\views\field\Date;
use Drupal\Core\Session\AccountInterface;

/**
 * Field handler to display the most recent time the node has been viewed.
 *
 * @ingroup views_field_handlers
 *
 * @ViewsField("node_counter_timestamp")
 */
class NodeCounterTimestamp extends Date {

  /**
   * {@inheritdoc}
   */
  public function access(AccountInterface $account) {
    return $account
      ->hasPermission('view post access counter');
  }

}

Classes

Namesort descending Description
NodeCounterTimestamp Field handler to display the most recent time the node has been viewed.