public static function ContentModerationStateFormatter::isApplicable in Drupal 8
Same name and namespace in other branches
- 9 core/modules/content_moderation/src/Plugin/Field/FieldFormatter/ContentModerationStateFormatter.php \Drupal\content_moderation\Plugin\Field\FieldFormatter\ContentModerationStateFormatter::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
- core/
modules/ content_moderation/ src/ Plugin/ Field/ FieldFormatter/ ContentModerationStateFormatter.php, line 73
Class
- ContentModerationStateFormatter
- Plugin implementation of the 'content_moderation_state' formatter.
Namespace
Drupal\content_moderation\Plugin\Field\FieldFormatterCode
public static function isApplicable(FieldDefinitionInterface $field_definition) {
return $field_definition
->getName() === 'moderation_state' && $field_definition
->getTargetEntityTypeId() !== 'content_moderation_state';
}