You are here

public static function ContactAutocompleteWidget::isApplicable in RedHen CRM 8

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/redhen_contact/src/Plugin/Field/FieldWidget/ContactAutocompleteWidget.php, line 142

Class

ContactAutocompleteWidget
Plugin implementation of the 'redhen_contact_autocomplete' widget.

Namespace

Drupal\redhen_contact\Plugin\Field\FieldWidget

Code

public static function isApplicable(FieldDefinitionInterface $field_definition) {
  $item_definition = $field_definition
    ->getItemDefinition();
  if ($item_definition
    ->getSetting('target_type') != 'redhen_contact') {
    return FALSE;
  }
  return parent::isApplicable($field_definition);
}