public static function BaseFieldFileFormatterBase::isApplicable in Drupal 8
Same name and namespace in other branches
- 9 core/modules/file/src/Plugin/Field/FieldFormatter/BaseFieldFileFormatterBase.php \Drupal\file\Plugin\Field\FieldFormatter\BaseFieldFileFormatterBase::isApplicable()
- 10 core/modules/file/src/Plugin/Field/FieldFormatter/BaseFieldFileFormatterBase.php \Drupal\file\Plugin\Field\FieldFormatter\BaseFieldFileFormatterBase::isApplicable()
Returns if the formatter can be used for the provided field.
Parameters
\Drupal\Core\Field\FieldDefinitionInterface $field_definition: The field definition that should be checked.
Return value
bool TRUE if the formatter can be used, FALSE otherwise.
Overrides FormatterBase::isApplicable
3 calls to BaseFieldFileFormatterBase::isApplicable()
- FileExtensionFormatter::isApplicable in core/
modules/ file/ src/ Plugin/ Field/ FieldFormatter/ FileExtensionFormatter.php - Returns if the formatter can be used for the provided field.
- FilemimeFormatter::isApplicable in core/
modules/ file/ src/ Plugin/ Field/ FieldFormatter/ FilemimeFormatter.php - Returns if the formatter can be used for the provided field.
- FileUriFormatter::isApplicable in core/
modules/ file/ src/ Plugin/ Field/ FieldFormatter/ FileUriFormatter.php - Returns if the formatter can be used for the provided field.
3 methods override BaseFieldFileFormatterBase::isApplicable()
- FileExtensionFormatter::isApplicable in core/
modules/ file/ src/ Plugin/ Field/ FieldFormatter/ FileExtensionFormatter.php - Returns if the formatter can be used for the provided field.
- FilemimeFormatter::isApplicable in core/
modules/ file/ src/ Plugin/ Field/ FieldFormatter/ FilemimeFormatter.php - Returns if the formatter can be used for the provided field.
- FileUriFormatter::isApplicable in core/
modules/ file/ src/ Plugin/ Field/ FieldFormatter/ FileUriFormatter.php - Returns if the formatter can be used for the provided field.
File
- core/
modules/ file/ src/ Plugin/ Field/ FieldFormatter/ BaseFieldFileFormatterBase.php, line 97
Class
- BaseFieldFileFormatterBase
- Base class for file formatters, which allow to link to the file download URL.
Namespace
Drupal\file\Plugin\Field\FieldFormatterCode
public static function isApplicable(FieldDefinitionInterface $field_definition) {
return $field_definition
->getTargetEntityTypeId() === 'file';
}