Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
VisitorsNumeric | |
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\Plugin\views\field\NumericField; |
7 | |
8 | /** |
9 | * Field handler to display numeric values from the visitors module. |
10 | * |
11 | * @ingroup views_field_handlers |
12 | * |
13 | * @ViewsField("visitors_numeric") |
14 | */ |
15 | class VisitorsNumeric extends NumericField { |
16 | |
17 | /** |
18 | * {@inheritdoc} |
19 | */ |
20 | public function access(AccountInterface $account) { |
21 | return $account->hasPermission('view visitors counter'); |
22 | } |
23 | |
24 | } |