You are here

public static function FlippingBookIframeFormatter::isApplicable in Flipping Book 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 FormatterBase::isApplicable

File

src/Plugin/Field/FieldFormatter/FlippingBookIframeFormatter.php, line 122

Class

FlippingBookIframeFormatter
Plugin implementation of the 'flipping_book_iframe_formatter' formatter.

Namespace

Drupal\flipping_book\Plugin\Field\FieldFormatter

Code

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