You are here

public static function CommentPermalinkFormatter::isApplicable in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/comment/src/Plugin/Field/FieldFormatter/CommentPermalinkFormatter.php \Drupal\comment\Plugin\Field\FieldFormatter\CommentPermalinkFormatter::isApplicable()
  2. 10 core/modules/comment/src/Plugin/Field/FieldFormatter/CommentPermalinkFormatter.php \Drupal\comment\Plugin\Field\FieldFormatter\CommentPermalinkFormatter::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/comment/src/Plugin/Field/FieldFormatter/CommentPermalinkFormatter.php, line 47

Class

CommentPermalinkFormatter
Plugin implementation of the 'comment_permalink' formatter.

Namespace

Drupal\comment\Plugin\Field\FieldFormatter

Code

public static function isApplicable(FieldDefinitionInterface $field_definition) {
  return parent::isApplicable($field_definition) && $field_definition
    ->getTargetEntityTypeId() === 'comment' && $field_definition
    ->getName() === 'subject';
}