public static function OrderTotalSummary::isApplicable in Commerce Core 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
- modules/
order/ src/ Plugin/ Field/ FieldFormatter/ OrderTotalSummary.php, line 95
Class
- OrderTotalSummary
- Plugin implementation of the 'commerce_order_total_summary' formatter.
Namespace
Drupal\commerce_order\Plugin\Field\FieldFormatterCode
public static function isApplicable(FieldDefinitionInterface $field_definition) {
$entity_type = $field_definition
->getTargetEntityTypeId();
$field_name = $field_definition
->getName();
return $entity_type == 'commerce_order' && $field_name == 'total_price';
}