function AuthorFormatter::isApplicable

Same name and namespace in other branches
  1. 9 core/modules/user/src/Plugin/Field/FieldFormatter/AuthorFormatter.php \Drupal\user\Plugin\Field\FieldFormatter\AuthorFormatter::isApplicable()
  2. 10 core/modules/user/src/Plugin/Field/FieldFormatter/AuthorFormatter.php \Drupal\user\Plugin\Field\FieldFormatter\AuthorFormatter::isApplicable()
  3. 11.x core/modules/user/src/Plugin/Field/FieldFormatter/AuthorFormatter.php \Drupal\user\Plugin\Field\FieldFormatter\AuthorFormatter::isApplicable()

Overrides FormatterBase::isApplicable

File

core/modules/user/src/Plugin/Field/FieldFormatter/AuthorFormatter.php, line 48

Class

AuthorFormatter
Plugin implementation of the 'author' formatter.

Namespace

Drupal\user\Plugin\Field\FieldFormatter

Code

public static function isApplicable(FieldDefinitionInterface $field_definition) {
    return $field_definition->getFieldStorageDefinition()
        ->getSetting('target_type') == 'user';
}

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