function EntityReferenceLabelFormatter::checkAccess

Same name and namespace in other branches
  1. 8.9.x core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/EntityReferenceLabelFormatter.php \Drupal\Core\Field\Plugin\Field\FieldFormatter\EntityReferenceLabelFormatter::checkAccess()
  2. 10 core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/EntityReferenceLabelFormatter.php \Drupal\Core\Field\Plugin\Field\FieldFormatter\EntityReferenceLabelFormatter::checkAccess()
  3. 11.x core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/EntityReferenceLabelFormatter.php \Drupal\Core\Field\Plugin\Field\FieldFormatter\EntityReferenceLabelFormatter::checkAccess()

Overrides EntityReferenceFormatterBase::checkAccess

File

core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/EntityReferenceLabelFormatter.php, line 107

Class

EntityReferenceLabelFormatter
Plugin implementation of the 'entity reference label' formatter.

Namespace

Drupal\Core\Field\Plugin\Field\FieldFormatter

Code

protected function checkAccess(EntityInterface $entity) {
    return $entity->access('view label', NULL, TRUE);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.