public function FieldTypePluginManager::getPreconfiguredOptions in Drupal 8
Same name and namespace in other branches
- 9 core/lib/Drupal/Core/Field/FieldTypePluginManager.php \Drupal\Core\Field\FieldTypePluginManager::getPreconfiguredOptions()
Returns preconfigured field options for a field type.
This is a wrapper around \Drupal\Core\Field\PreconfiguredFieldUiOptionsInterface::getPreconfiguredOptions() allowing modules to alter the result of this method by implementing hook_field_ui_preconfigured_options_alter().
Parameters
string $field_type: The field type plugin ID.
Return value
array A multi-dimensional array as returned from \Drupal\Core\Field\PreconfiguredFieldUiOptionsInterface::getPreconfiguredOptions().
Overrides FieldTypePluginManagerInterface::getPreconfiguredOptions
See also
\Drupal\Core\Field\PreconfiguredFieldUiOptionsInterface::getPreconfiguredOptions()
hook_field_ui_preconfigured_options_alter()
1 call to FieldTypePluginManager::getPreconfiguredOptions()
- FieldTypePluginManager::getUiDefinitions in core/
lib/ Drupal/ Core/ Field/ FieldTypePluginManager.php - Gets the definition of all field types that can be added via UI.
File
- core/
lib/ Drupal/ Core/ Field/ FieldTypePluginManager.php, line 156
Class
- FieldTypePluginManager
- Plugin manager for 'field type' plugins.
Namespace
Drupal\Core\FieldCode
public function getPreconfiguredOptions($field_type) {
$options = [];
$class = $this
->getPluginClass($field_type);
if (is_subclass_of($class, '\\Drupal\\Core\\Field\\PreconfiguredFieldUiOptionsInterface')) {
$options = $class::getPreconfiguredOptions();
$this->moduleHandler
->alter('field_ui_preconfigured_options', $options, $field_type);
}
return $options;
}