You are here

public static function MiconMenuWidget::isApplicable in Micon 2.x

Same name and namespace in other branches
  1. 8 micon_menu/src/Plugin/Field/FieldWidget/MiconMenuWidget.php \Drupal\micon_menu\Plugin\Field\FieldWidget\MiconMenuWidget::isApplicable()

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

micon_menu/src/Plugin/Field/FieldWidget/MiconMenuWidget.php, line 62

Class

MiconMenuWidget
Plugin implementation of the 'link' widget.

Namespace

Drupal\micon_menu\Plugin\Field\FieldWidget

Code

public static function isApplicable(FieldDefinitionInterface $field_definition) {

  // Only make this widget available to menu_link_content.
  return $field_definition
    ->getTargetEntityTypeId() == 'menu_link_content';
}