You are here

public function WidgetPluginManager::getDefaultSettings in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/Field/WidgetPluginManager.php \Drupal\Core\Field\WidgetPluginManager::getDefaultSettings()

Returns the default settings of a field widget.

Parameters

string $type: A field widget type name.

Return value

array The widget type's default settings, as provided by the plugin definition, or an empty array if type or settings are undefined.

1 call to WidgetPluginManager::getDefaultSettings()
WidgetPluginManager::prepareConfiguration in core/lib/Drupal/Core/Field/WidgetPluginManager.php
Merges default values for widget configuration.

File

core/lib/Drupal/Core/Field/WidgetPluginManager.php, line 207
Contains \Drupal\Core\Field\WidgetPluginManager.

Class

WidgetPluginManager
Plugin type manager for field widgets.

Namespace

Drupal\Core\Field

Code

public function getDefaultSettings($type) {
  $plugin_definition = $this
    ->getDefinition($type, FALSE);
  if (!empty($plugin_definition['class'])) {
    $plugin_class = DefaultFactory::getPluginClass($type, $plugin_definition);
    return $plugin_class::defaultSettings();
  }
  return array();
}