Version 1
[yaffs-website] / web / core / modules / statistics / src / Plugin / views / field / StatisticsNumeric.php
diff --git a/web/core/modules/statistics/src/Plugin/views/field/StatisticsNumeric.php b/web/core/modules/statistics/src/Plugin/views/field/StatisticsNumeric.php
new file mode 100644 (file)
index 0000000..a425b31
--- /dev/null
@@ -0,0 +1,24 @@
+<?php
+
+namespace Drupal\statistics\Plugin\views\field;
+
+use Drupal\views\Plugin\views\field\NumericField;
+use Drupal\Core\Session\AccountInterface;
+
+/**
+ * Field handler to display numeric values from the statistics module.
+ *
+ * @ingroup views_field_handlers
+ *
+ * @ViewsField("statistics_numeric")
+ */
+class StatisticsNumeric extends NumericField {
+
+  /**
+   * {@inheritdoc}
+   */
+  public function access(AccountInterface $account) {
+    return $account->hasPermission('view post access counter');
+  }
+
+}