Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. PreconfiguredFieldUiOptionsInterface.php

function PreconfiguredFieldUiOptionsInterface::getPreconfiguredOptions

Returns preconfigured field options for a field type.

Note that if you want to give modules an opportunity to alter the result of this method, you should call \Drupal\Core\Field\FieldTypePluginManagerInterface::getPreconfiguredOptions() instead.

Return value

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 also

\Drupal\field\Entity\FieldStorageConfig

\Drupal\field\Entity\FieldConfig

\Drupal\Core\Entity\Display\EntityDisplayInterface::setComponent()

\Drupal\Core\Field\FieldTypePluginManagerInterface::getPreconfiguredOptions()

1 method overrides PreconfiguredFieldUiOptionsInterface::getPreconfiguredOptions()
EntityReferenceItem::getPreconfiguredOptions in core/lib/Drupal/Core/Field/Plugin/Field/FieldType/EntityReferenceItem.php
Returns preconfigured field options for a field type.

File

core/lib/Drupal/Core/Field/PreconfiguredFieldUiOptionsInterface.php, line 45

Class

PreconfiguredFieldUiOptionsInterface
Defines an interface for exposing "preconfigured" field definitions.

Namespace

Drupal\Core\Field

Code

public static function getPreconfiguredOptions();

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal