You are here

public static function PhotoswipeResponsiveFieldFormatter::isApplicable in PhotoSwipe 3.x

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/PhotoswipeResponsiveFieldFormatter.php, line 110

Class

PhotoswipeResponsiveFieldFormatter
Provides formatter that supports responsive image.

Namespace

Drupal\photoswipe\Plugin\Field\FieldFormatter

Code

public static function isApplicable(FieldDefinitionInterface $field_definition) {
  return \Drupal::service('module_handler')
    ->moduleExists('responsive_image') ? parent::isApplicable($field_definition) : FALSE;
}