3 namespace Drupal\Core\Field;
6 * Defines an interface for exposing "preconfigured" field definitions.
8 * These field definitions will be exposed as additional options in the 'Add
9 * field' form in Field UI, together with individual field types.
11 * @see \Drupal\Core\Field\FieldTypePluginManager::getUiDefinitions()
12 * @see \Drupal\field_ui\Form\FieldStorageAddForm::submitForm()
14 interface PreconfiguredFieldUiOptionsInterface {
17 * Returns preconfigured field options for a field type.
20 * A multi-dimensional array with string keys and the following structure:
21 * - label: The label to show in the field type selection list.
22 * - category: (optional) The category in which to put the field label.
23 * Defaults to the category of the field type.
24 * - field_storage_config: An array with the following supported keys:
25 * - cardinality: The field cardinality.
26 * - settings: Field-type specific storage settings.
27 * - field_config: An array with the following supported keys:
28 * - required: Indicates whether the field is required.
29 * - settings: Field-type specific settings.
30 * - entity_form_display: An array with the following supported keys:
31 * - type: The widget to be used in the 'default' form mode.
32 * - entity_view_display: An array with the following supported keys:
33 * - type: The formatter to be used in the 'default' view mode.
35 * @see \Drupal\field\Entity\FieldStorageConfig
36 * @see \Drupal\field\Entity\FieldConfig
37 * @see \Drupal\Core\Entity\Display\EntityDisplayInterface::setComponent()
39 public static function getPreconfiguredOptions();