You are here

public function FieldTypePluginManager::getDefaultStorageSettings in Drupal 9

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Field/FieldTypePluginManager.php \Drupal\Core\Field\FieldTypePluginManager::getDefaultStorageSettings()

Returns the default storage-level settings for a field type.

Parameters

string $type: A field type name.

Return value

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

Overrides FieldTypePluginManagerInterface::getDefaultStorageSettings

File

core/lib/Drupal/Core/Field/FieldTypePluginManager.php, line 103

Class

FieldTypePluginManager
Plugin manager for 'field type' plugins.

Namespace

Drupal\Core\Field

Code

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