Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
VisitorsCounterTimestamp | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
access | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 |
1 | <?php |
2 | |
3 | namespace Drupal\visitors\Plugin\views\field; |
4 | |
5 | use Drupal\Core\Session\AccountInterface; |
6 | use Drupal\views\Attribute\ViewsField; |
7 | use Drupal\views\Plugin\views\field\Date; |
8 | |
9 | /** |
10 | * Field handler to display the most recent time the node has been viewed. |
11 | * |
12 | * @ingroup views_field_handlers |
13 | */ |
14 | #[ViewsField("visitors_counter_timestamp")] |
15 | class VisitorsCounterTimestamp extends Date { |
16 | |
17 | /** |
18 | * {@inheritdoc} |
19 | */ |
20 | public function access(AccountInterface $account) { |
21 | return $account->hasPermission('view visitors counter'); |
22 | } |
23 | |
24 | } |