annotate core/lib/Drupal/Core/Field/PreconfiguredFieldUiOptionsInterface.php @ 19:fa3358dc1485 tip

Add ndrum files
author Chris Cannam
date Wed, 28 Aug 2019 13:14:47 +0100
parents 1fec387a4317
children
rev   line source
Chris@0 1 <?php
Chris@0 2
Chris@0 3 namespace Drupal\Core\Field;
Chris@0 4
Chris@0 5 /**
Chris@0 6 * Defines an interface for exposing "preconfigured" field definitions.
Chris@0 7 *
Chris@0 8 * These field definitions will be exposed as additional options in the 'Add
Chris@0 9 * field' form in Field UI, together with individual field types.
Chris@0 10 *
Chris@0 11 * @see \Drupal\Core\Field\FieldTypePluginManager::getUiDefinitions()
Chris@0 12 * @see \Drupal\field_ui\Form\FieldStorageAddForm::submitForm()
Chris@0 13 */
Chris@0 14 interface PreconfiguredFieldUiOptionsInterface {
Chris@0 15
Chris@0 16 /**
Chris@0 17 * Returns preconfigured field options for a field type.
Chris@0 18 *
Chris@14 19 * Note that if you want to give modules an opportunity to alter the result
Chris@14 20 * of this method, you should call
Chris@14 21 * \Drupal\Core\Field\FieldTypePluginManagerInterface::getPreconfiguredOptions()
Chris@14 22 * instead.
Chris@14 23 *
Chris@0 24 * @return mixed[][]
Chris@0 25 * A multi-dimensional array with string keys and the following structure:
Chris@0 26 * - label: The label to show in the field type selection list.
Chris@0 27 * - category: (optional) The category in which to put the field label.
Chris@0 28 * Defaults to the category of the field type.
Chris@0 29 * - field_storage_config: An array with the following supported keys:
Chris@0 30 * - cardinality: The field cardinality.
Chris@0 31 * - settings: Field-type specific storage settings.
Chris@0 32 * - field_config: An array with the following supported keys:
Chris@0 33 * - required: Indicates whether the field is required.
Chris@0 34 * - settings: Field-type specific settings.
Chris@0 35 * - entity_form_display: An array with the following supported keys:
Chris@0 36 * - type: The widget to be used in the 'default' form mode.
Chris@0 37 * - entity_view_display: An array with the following supported keys:
Chris@0 38 * - type: The formatter to be used in the 'default' view mode.
Chris@0 39 *
Chris@0 40 * @see \Drupal\field\Entity\FieldStorageConfig
Chris@0 41 * @see \Drupal\field\Entity\FieldConfig
Chris@0 42 * @see \Drupal\Core\Entity\Display\EntityDisplayInterface::setComponent()
Chris@14 43 * @see \Drupal\Core\Field\FieldTypePluginManagerInterface::getPreconfiguredOptions()
Chris@0 44 */
Chris@0 45 public static function getPreconfiguredOptions();
Chris@0 46
Chris@0 47 }