public static function VideoJsPlayerListFormatter::isApplicable in Video.js (HTML5 Video Player) 8
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 VideoJsPlayerFormatter::isApplicable
File
- src/
Plugin/ Field/ FieldFormatter/ VideoJsPlayerListFormatter.php, line 68 - Contains \Drupal\videojs\Plugin\Field\FieldFormatter\VideoJsPlayerListFormatter.
Class
- VideoJsPlayerListFormatter
- Plugin implementation of the 'videojs_player_list' formatter.
Namespace
Drupal\videojs\Plugin\Field\FieldFormatterCode
public static function isApplicable(FieldDefinitionInterface $field_definition) {
$entity_form_display = entity_get_form_display($field_definition
->getTargetEntityTypeId(), $field_definition
->getTargetBundle(), 'default');
$widget = $entity_form_display
->getRenderer($field_definition
->getName());
$widget_id = $widget
->getBaseId();
if ($field_definition
->isList()) {
return TRUE;
}
return FALSE;
}