You are here

interface PreconfiguredFieldUiOptionsInterface in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/Field/PreconfiguredFieldUiOptionsInterface.php \Drupal\Core\Field\PreconfiguredFieldUiOptionsInterface

Defines an interface for exposing "preconfigured" field definitions.

These field definitions will be exposed as additional options in the 'Add field' form in Field UI, together with individual field types.

Hierarchy

Expanded class hierarchy of PreconfiguredFieldUiOptionsInterface

All classes that implement PreconfiguredFieldUiOptionsInterface

See also

\Drupal\Core\Field\FieldTypePluginManager::getUiDefinitions()

\Drupal\field_ui\Form\FieldStorageAddForm::submitForm()

2 files declare their use of PreconfiguredFieldUiOptionsInterface
EntityReferenceItem.php in core/lib/Drupal/Core/Field/Plugin/Field/FieldType/EntityReferenceItem.php
Contains \Drupal\Core\Field\Plugin\Field\FieldType\EntityReferenceItem.
TestItemWithPreconfiguredOptions.php in core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldType/TestItemWithPreconfiguredOptions.php
Contains \Drupal\field_test\Plugin\Field\FieldType\TestItemWithPreconfiguredOptions.

File

core/lib/Drupal/Core/Field/PreconfiguredFieldUiOptionsInterface.php, line 19
Contains \Drupal\Core\Field\PreconfiguredFieldUiOptionsInterface.

Namespace

Drupal\Core\Field
View source
interface PreconfiguredFieldUiOptionsInterface {

  /**
   * Returns preconfigured field options for a field type.
   *
   * @return mixed[][]
   *   A multi-dimensional array with string keys and the following structure:
   *   - label: The label to show in the field type selection list.
   *   - category: (optional) The category in which to put the field label.
   *     Defaults to the category of the field type.
   *   - field_storage_config: An array with the following supported keys:
   *     - cardinality: The field cardinality.
   *     - settings: Field-type specific storage settings.
   *   - field_config: An array with the following supported keys:
   *     - required: Indicates whether the field is required.
   *     - settings: Field-type specific settings.
   *   - entity_form_display: An array with the following supported keys:
   *     - type: The widget to be used in the 'default' form mode.
   *   - entity_view_display: An array with the following supported keys:
   *     - type: The formatter to be used in the 'default' view mode.
   *
   * @see \Drupal\field\Entity\FieldStorageConfig
   * @see \Drupal\field\Entity\FieldConfig
   * @see \Drupal\Core\Entity\Display\EntityDisplayInterface::setComponent()
   */
  public static function getPreconfiguredOptions();

}

Members

Namesort descending Modifiers Type Description Overrides
PreconfiguredFieldUiOptionsInterface::getPreconfiguredOptions public static function Returns preconfigured field options for a field type. 2