You are here

public static function TestFieldApplicableFormatter::isApplicable in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldFormatter/TestFieldApplicableFormatter.php \Drupal\field_test\Plugin\Field\FieldFormatter\TestFieldApplicableFormatter::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/field/tests/modules/field_test/src/Plugin/Field/FieldFormatter/TestFieldApplicableFormatter.php, line 29

Class

TestFieldApplicableFormatter
Plugin implementation of the 'field_test_applicable' formatter.

Namespace

Drupal\field_test\Plugin\Field\FieldFormatter

Code

public static function isApplicable(FieldDefinitionInterface $field_definition) {
  return $field_definition
    ->getName() != 'deny_applicable';
}