public static function DownloadLinkFieldFormatter::isApplicable in Media Entity Download 8
Same name and namespace in other branches
- 8.2 src/Plugin/Field/FieldFormatter/DownloadLinkFieldFormatter.php \Drupal\media_entity_download\Plugin\Field\FieldFormatter\DownloadLinkFieldFormatter::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
File
- src/
Plugin/ Field/ FieldFormatter/ DownloadLinkFieldFormatter.php, line 85
Class
- DownloadLinkFieldFormatter
- Plugin implementation of the 'media_entity_download_download_link' formatter.
Namespace
Drupal\media_entity_download\Plugin\Field\FieldFormatterCode
public static function isApplicable(FieldDefinitionInterface $field_definition) {
return $field_definition
->getFieldStorageDefinition()
->getTargetEntityTypeId() == 'media';
}