public static function ShippingProfileWidget::isApplicable in Commerce Shipping 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
- src/
Plugin/ Field/ FieldWidget/ ShippingProfileWidget.php, line 142
Class
- ShippingProfileWidget
- Plugin implementation of 'commerce_shipping_profile'.
Namespace
Drupal\commerce_shipping\Plugin\Field\FieldWidgetCode
public static function isApplicable(FieldDefinitionInterface $field_definition) {
$entity_type = $field_definition
->getTargetEntityTypeId();
$field_name = $field_definition
->getName();
return $entity_type == 'commerce_shipment' && $field_name == 'shipping_profile';
}