function BaseFieldFileFormatterBase::isApplicable

Same name and namespace in other branches
  1. 10 core/modules/file/src/Plugin/Field/FieldFormatter/BaseFieldFileFormatterBase.php \Drupal\file\Plugin\Field\FieldFormatter\BaseFieldFileFormatterBase::isApplicable()
  2. 11.x core/modules/file/src/Plugin/Field/FieldFormatter/BaseFieldFileFormatterBase.php \Drupal\file\Plugin\Field\FieldFormatter\BaseFieldFileFormatterBase::isApplicable()
  3. 8.9.x core/modules/file/src/Plugin/Field/FieldFormatter/BaseFieldFileFormatterBase.php \Drupal\file\Plugin\Field\FieldFormatter\BaseFieldFileFormatterBase::isApplicable()
1 method overrides BaseFieldFileFormatterBase::isApplicable()
FilemimeFormatter::isApplicable in core/modules/file/src/Plugin/Field/FieldFormatter/FilemimeFormatter.php
Returns if the formatter can be used for the provided field.

File

core/modules/file/src/Plugin/Field/FieldFormatter/BaseFieldFileFormatterBase.php, line 138

Class

BaseFieldFileFormatterBase
Base class for file formatters, which allow to link to the file download URL.

Namespace

Drupal\file\Plugin\Field\FieldFormatter

Code

public static function isApplicable(FieldDefinitionInterface $field_definition) {
  return $field_definition->getTargetEntityTypeId() === 'file';
}

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