function ContentModerationStateFormatter::isApplicable

Same name in other branches
  1. 9 core/modules/content_moderation/src/Plugin/Field/FieldFormatter/ContentModerationStateFormatter.php \Drupal\content_moderation\Plugin\Field\FieldFormatter\ContentModerationStateFormatter::isApplicable()
  2. 10 core/modules/content_moderation/src/Plugin/Field/FieldFormatter/ContentModerationStateFormatter.php \Drupal\content_moderation\Plugin\Field\FieldFormatter\ContentModerationStateFormatter::isApplicable()
  3. 11.x core/modules/content_moderation/src/Plugin/Field/FieldFormatter/ContentModerationStateFormatter.php \Drupal\content_moderation\Plugin\Field\FieldFormatter\ContentModerationStateFormatter::isApplicable()

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\FieldFormatter

Code

public static function isApplicable(FieldDefinitionInterface $field_definition) {
    return $field_definition->getName() === 'moderation_state' && $field_definition->getTargetEntityTypeId() !== 'content_moderation_state';
}

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