annotate core/lib/Drupal/Core/Field/PreconfiguredFieldUiOptionsInterface.php @ 0:4c8ae668cc8c

Initial import (non-working)
author Chris Cannam
date Wed, 29 Nov 2017 16:09:58 +0000
parents
children 1fec387a4317
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@0 19 * @return mixed[][]
Chris@0 20 * A multi-dimensional array with string keys and the following structure:
Chris@0 21 * - label: The label to show in the field type selection list.
Chris@0 22 * - category: (optional) The category in which to put the field label.
Chris@0 23 * Defaults to the category of the field type.
Chris@0 24 * - field_storage_config: An array with the following supported keys:
Chris@0 25 * - cardinality: The field cardinality.
Chris@0 26 * - settings: Field-type specific storage settings.
Chris@0 27 * - field_config: An array with the following supported keys:
Chris@0 28 * - required: Indicates whether the field is required.
Chris@0 29 * - settings: Field-type specific settings.
Chris@0 30 * - entity_form_display: An array with the following supported keys:
Chris@0 31 * - type: The widget to be used in the 'default' form mode.
Chris@0 32 * - entity_view_display: An array with the following supported keys:
Chris@0 33 * - type: The formatter to be used in the 'default' view mode.
Chris@0 34 *
Chris@0 35 * @see \Drupal\field\Entity\FieldStorageConfig
Chris@0 36 * @see \Drupal\field\Entity\FieldConfig
Chris@0 37 * @see \Drupal\Core\Entity\Display\EntityDisplayInterface::setComponent()
Chris@0 38 */
Chris@0 39 public static function getPreconfiguredOptions();
Chris@0 40
Chris@0 41 }