function FieldTypePluginManager::getDefaultFieldSettings

Same name in other branches
  1. 8.9.x core/lib/Drupal/Core/Field/FieldTypePluginManager.php \Drupal\Core\Field\FieldTypePluginManager::getDefaultFieldSettings()
  2. 10 core/lib/Drupal/Core/Field/FieldTypePluginManager.php \Drupal\Core\Field\FieldTypePluginManager::getDefaultFieldSettings()
  3. 11.x core/lib/Drupal/Core/Field/FieldTypePluginManager.php \Drupal\Core\Field\FieldTypePluginManager::getDefaultFieldSettings()

Overrides FieldTypePluginManagerInterface::getDefaultFieldSettings

File

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

Class

FieldTypePluginManager
Plugin manager for 'field type' plugins.

Namespace

Drupal\Core\Field

Code

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.