You are here

public static function QuantityWidget::isApplicable in Commerce Core 8.2

Returns if the widget 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 widget can be used, FALSE otherwise.

Overrides WidgetBase::isApplicable

File

modules/order/src/Plugin/Field/FieldWidget/QuantityWidget.php, line 115

Class

QuantityWidget
Plugin implementation of the 'commerce_quantity' widget.

Namespace

Drupal\commerce_order\Plugin\Field\FieldWidget

Code

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