You are here

protected static function PluginSelectWidget::supportsConfiguration in Commerce Core 8.2

Determines whether plugin configuration is supported.

Supported if the plugins implement PluginFormInterface.

Parameters

array $definitions: The available plugin definitions.

Return value

bool TRUE if plugin configuration is supported, FALSE otherwise.

1 call to PluginSelectWidget::supportsConfiguration()
PluginSelectWidget::formElement in src/Plugin/Field/FieldWidget/PluginSelectWidget.php
Returns the form for a single field widget.

File

src/Plugin/Field/FieldWidget/PluginSelectWidget.php, line 161

Class

PluginSelectWidget
Plugin implementation of the 'commerce_plugin_select' widget.

Namespace

Drupal\commerce\Plugin\Field\FieldWidget

Code

protected static function supportsConfiguration(array $definitions) {

  // The plugin manager has $this->pluginInterface, but there's no getter
  // for it, so it can't be used to check for PluginFormInterface.
  // Instead, we assume that all plugins implement the same interfaces,
  // and perform the check against the first plugin.
  $definition = reset($definitions);
  return is_subclass_of($definition['class'], PluginFormInterface::class);
}