diff --git a/core/modules/field/lib/Drupal/field/Plugin/Core/Entity/Field.php b/core/modules/field/lib/Drupal/field/Plugin/Core/Entity/Field.php index 0af61ae..36e263f 100644 --- a/core/modules/field/lib/Drupal/field/Plugin/Core/Entity/Field.php +++ b/core/modules/field/lib/Drupal/field/Plugin/Core/Entity/Field.php @@ -211,28 +211,30 @@ class Field extends ConfigEntityBase implements FieldInterface { /** * Constructs a Field object. - * - * @param array $values - * An array of values to set, keyed by property name. For specific property - * description, please refer respective property inside this class. - * - id: required. Only lowercase alphanumeric characters and underscores - * are allowed, and only lowercase letters and underscore are allowed - * as the first character. - * - type: required. - * - module: required. - * - active: required. - * - settings: optional. - * - cardinality: optional. Default to be 1. - * - translatable: optional. Default to be FALSE. - * - entity_types: optional. Default to be an empty array. - * - locked: optional. Default to be FALSE. - * - storage: optional. - * - indexes: optional. - * - deleted: optional. Default to be FALSE. - * - schema: optional. - * - storageDetails: optional. - * - * See: @link field Field API data structures @endlink. + * In most cases, it's constructed via entity_create('field_entity', $values). + * + * @param array $values + * An array of values to set, keyed by property name. For specific property + * description, please refer respective property inside this class. + * - id: required. It's used to replace the original 'field_name' property. + * Only lowercase alphanumeric characters and underscores are allowed, and + * only lowercase letters and underscore are allowed as the first character. + * - type: required. + * - module: optional. + * - active: optional. + * - settings: optional. + * - cardinality: optional. Default to be 1. + * - translatable: optional. Default to be FALSE. + * - entity_types: optional. + * - locked: optional. Default to be FALSE. + * - storage: optional. + * - indexes: optional. + * - deleted: optional. Default to be FALSE. + * - schema: optional. + * - storageDetails: optional. + * + * See: @link entity_create @endlink. + * See: @link field Field API data structures @endlink. */ public function __construct(array $values, $entity_type = 'field_entity') { // Check required properties. diff --git a/core/modules/field/lib/Drupal/field/Plugin/Core/Entity/FieldInstance.php b/core/modules/field/lib/Drupal/field/Plugin/Core/Entity/FieldInstance.php index 2942fd4..8c7a422 100644 --- a/core/modules/field/lib/Drupal/field/Plugin/Core/Entity/FieldInstance.php +++ b/core/modules/field/lib/Drupal/field/Plugin/Core/Entity/FieldInstance.php @@ -226,7 +226,31 @@ class FieldInstance extends ConfigEntityBase implements FieldInstanceInterface { protected $bundle_rename_allowed = FALSE; /** - * {@inheritdoc} + * Constructs a Field object. + * In most cases, it's constructed via entity_create('field_instance', $values). + * + * @param array $values + * An array of values to set, keyed by property name. For specific property + * description, please refer respective property inside this class. + * - field_name: optional. This field instance is attached to this field. + * - field_uuid: optional. Either this property or field_name is required + * to build field instance. Property field_name will gain higher priority. + * If field_name is not provided, field_uuid will be checked. + * - entity_type: required. + * - bundle: required. + * - label: optional. + * - description: optional. + * - settings: optional. + * - required: optional. Default to be FALSE. + * - default_value: optional. + * - default_value_function: optional. + * - widget: optional. + * - deleted: optional. Default to be FALSE. + * - field: optional. + * - widgetPlugin: optional. + * - bundle_rename_allowed : optional. + * + * See: @link entity_create @endlink. */ public function __construct(array $values, $entity_type = 'field_instance') { // Accept incoming 'field_name' instead of 'field_uuid', for easier DX on