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