You are here

public static function BundleItemOrderItemTable::isApplicable in Commerce Product Bundle 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/BundleItemOrderItemTable.php, line 43

Class

BundleItemOrderItemTable
Plugin implementation of the 'cpb_item_order_item_table' formatter.

Namespace

Drupal\commerce_product_bundle\Plugin\Field\FieldFormatter

Code

public static function isApplicable(FieldDefinitionInterface $field_definition) {
  $entity_type = $field_definition
    ->getTargetEntityTypeId();
  $field_name = $field_definition
    ->getName();
  return $entity_type == 'commerce_order_item' && $field_name == 'bundle_item_order_items';
}