public static function LicenseExpirationFormatter::isApplicable in Commerce License 8.2
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/ LicenseExpirationFormatter.php, line 40
Class
- LicenseExpirationFormatter
- Plugin implementation of the 'commerce_license_expiration' formatter.
Namespace
Drupal\commerce_license\Plugin\Field\FieldFormatterCode
public static function isApplicable(FieldDefinitionInterface $field_definition) {
return $field_definition
->getTargetEntityTypeId() === 'commerce_license' && $field_definition
->getName() === 'expires';
}