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