diff --git a/core/lib/Drupal/Core/Field/FieldDefinitionInterface.php b/core/lib/Drupal/Core/Field/FieldDefinitionInterface.php index 302cf39..501aa4c 100644 --- a/core/lib/Drupal/Core/Field/FieldDefinitionInterface.php +++ b/core/lib/Drupal/Core/Field/FieldDefinitionInterface.php @@ -52,80 +52,7 @@ * based on that abstract definition, even though that abstract definition can * differ from the concrete definition of any particular node's body field. */ -interface FieldDefinitionInterface extends ListDataDefinitionInterface { - - /** - * Value indicating a field accepts an unlimited number of values. - */ - const CARDINALITY_UNLIMITED = -1; - - /** - * Returns the machine name of the field. - * - * This defines how the field data is accessed from the entity. For example, - * if the field name is "foo", then $entity->foo returns its data. - * - * @return string - * The field name. - */ - public function getName(); - - /** - * Returns the field type. - * - * @return string - * The field type, i.e. the id of a field type plugin. For example 'text'. - * - * @see \Drupal\Core\Field\FieldTypePluginManagerInterface - */ - public function getType(); - - /** - * Returns the field settings. - * - * Each field type defines the settings that are meaningful for that type. - * For example, a text field can define a 'max_length' setting, and an image - * field can define a 'alt_field_required' setting. - * - * @return array - * An array of key/value pairs. - */ - public function getSettings(); - - /** - * Returns the value of a given field setting. - * - * @param string $setting_name - * The setting name. - * - * @return mixed - * The setting value. - */ - public function getSetting($setting_name); - - /** - * Returns the name of the provider of this field. - * - * @return string - * The provider name; e.g., the module name. - */ - public function getProvider(); - - /** - * Returns whether the field is translatable. - * - * @return bool - * TRUE if the field is translatable. - */ - public function isTranslatable(); - - /** - * Returns whether the field is revisionable. - * - * @return bool - * TRUE if the field is revisionable. - */ - public function isRevisionable(); +interface FieldDefinitionInterface extends FieldStorageDefinitionInterface, ListDataDefinitionInterface { /** * Returns whether the display for the field can be configured. @@ -191,102 +118,6 @@ public function getDisplayOptions($display_context); public function getDefaultValue(EntityInterface $entity); /** - * Gets the definition of a contained property. - * - * @param string $name - * The name of property. - * - * @return \Drupal\Core\TypedData\DataDefinitionInterface|null - * The definition of the property or NULL if the property does not exist. - */ - public function getPropertyDefinition($name); - - /** - * Gets an array of property definitions of contained properties. - * - * @return \Drupal\Core\TypedData\DataDefinitionInterface[] - * An array of property definitions of contained properties, keyed by - * property name. - */ - public function getPropertyDefinitions(); - - /** - * Returns the names of the field's subproperties. - * - * A field is a list of items, and each item can contain one or more - * properties. All items for a given field contain the same property names, - * but the values can be different for each item. - * - * For example, an email field might just contain a single 'value' property, - * while a link field might contain 'title' and 'url' properties, and a text - * field might contain 'value', 'summary', and 'format' properties. - * - * @return array - * The property names. - */ - public function getPropertyNames(); - - /** - * Returns the name of the main property, if any. - * - * Some field items consist mainly of one main property, e.g. the value of a - * text field or the @code target_id @endcode of an entity reference. If the - * field item has no main property, the method returns NULL. - * - * @return string|null - * The name of the value property, or NULL if there is none. - */ - public function getMainPropertyName(); - - /** - * Returns the ID of the type of the entity this field is attached to. - * - * This method should not be confused with EntityInterface::entityType() - * (configurable fields are config entities, and thus implement both - * interfaces): - * - FieldDefinitionInterface::getTargetEntityTypeId() answers "as a field, - * which entity type are you attached to?". - * - EntityInterface::getEntityTypeId() answers "as a (config) entity, what - * is your own entity type". - * - * @return string - * The name of the entity type. - */ - public function getTargetEntityTypeId(); - - /** - * Returns the field schema. - * - * Note that this method returns an empty array for computed fields which have - * no schema. - * - * @return array - * The field schema, as an array of key/value pairs in the format returned - * by hook_field_schema(): - * - columns: An array of Schema API column specifications, keyed by column - * name. This specifies what comprises a single value for a given field. - * No assumptions should be made on how storage backends internally use - * the original column name to structure their storage. - * - indexes: An array of Schema API index definitions. Some storage - * backends might not support indexes. - * - foreign keys: An array of Schema API foreign key definitions. Note, - * however, that depending on the storage backend specified for the field, - * the field data is not necessarily stored in SQL. - */ - public function getSchema(); - - /** - * Returns the field columns, as defined in the field schema. - * - * @return array - * The array of field columns, keyed by column name, in the same format - * returned by getSchema(). - * - * @see \Drupal\Core\Field\FieldDefinitionInterface::getSchema() - */ - public function getColumns(); - - /** * Returns the storage behavior for this field. * * Indicates whether the entity type's storage controller should take care of diff --git a/core/modules/field/lib/Drupal/field/Entity/FieldConfig.php b/core/modules/field/lib/Drupal/field/Entity/FieldConfig.php index 81741bb..80b5cbe 100644 --- a/core/modules/field/lib/Drupal/field/Entity/FieldConfig.php +++ b/core/modules/field/lib/Drupal/field/Entity/FieldConfig.php @@ -525,8 +525,7 @@ public function getSettings() { $field_type_manager = \Drupal::service('plugin.manager.field.field_type'); $settings = $field_type_manager->getDefaultSettings($this->type); - $instance_settings = $field_type_manager->getDefaultInstanceSettings($this->type); - return $this->settings + $settings + $instance_settings; + return $this->settings + $settings; } /**