FieldTypePluginManagerInterface
interface FieldTypePluginManagerInterface implements PluginManagerInterface, CategorizingPluginManagerInterface (View source)
Defines an interface for the field type plugin manager.
Methods
Gets a specific plugin definition.
Indicates if a specific plugin definition exists.
Creates a pre-configured instance of a plugin.
Gets a preconfigured instance of a plugin.
Gets sorted plugin definitions.
Gets sorted plugin definitions grouped by category.
Creates a new field item list.
Creates a new field item as part of a field item list.
Returns the default field-level settings for a field type.
Returns the default storage-level settings for a field type.
Gets the definition of all field types that can be added via UI.
Returns preconfigured field options for a field type.
Returns the PHP class that implements the field type plugin.
Details
mixed
getDefinition(string $plugin_id, bool $exception_on_invalid = TRUE)
Gets a specific plugin definition.
array
getDefinitions()
Gets the definition of all plugins for this type.
bool
hasDefinition(string $plugin_id)
Indicates if a specific plugin definition exists.
object
createInstance(string $plugin_id, array $configuration = [])
Creates a pre-configured instance of a plugin.
object|false
getInstance(array $options)
Gets a preconfigured instance of a plugin.
string[]
getCategories()
Gets the names of all categories.
array[]
getSortedDefinitions(array $definitions = NULL)
Gets sorted plugin definitions.
array[]
getGroupedDefinitions(array $definitions = NULL)
Gets sorted plugin definitions grouped by category.
In addition to grouping, both categories and its entries are sorted, whereas plugin definitions are sorted by label.
FieldItemListInterface
createFieldItemList(FieldableEntityInterface $entity, string $field_name, mixed $values = NULL)
Creates a new field item list.
The provided entity is assigned as the parent of the created item list. However, it is the responsibility of the caller (usually the parent entity itself) to make the parent aware of the field as a new child.
FieldItemInterface
createFieldItem(FieldItemListInterface $items, int $index, array|null $values = NULL)
Creates a new field item as part of a field item list.
The provided item list is assigned as the parent of the created item. It However, it is the responsibility of the caller (usually the parent list itself) to have the parent aware of the item as a new child.
array
getDefaultFieldSettings(string $type)
Returns the default field-level settings for a field type.
array
getDefaultStorageSettings(string $type)
Returns the default storage-level settings for a field type.
array
getUiDefinitions()
Gets the definition of all field types that can be added via UI.
array
getPreconfiguredOptions(string $field_type)
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().
string
getPluginClass(string $type)
Returns the PHP class that implements the field type plugin.