diff --git a/core/lib/Drupal/Core/Entity/EntityManager.php b/core/lib/Drupal/Core/Entity/EntityManager.php index 18061b9..29b0d31 100644 --- a/core/lib/Drupal/Core/Entity/EntityManager.php +++ b/core/lib/Drupal/Core/Entity/EntityManager.php @@ -349,10 +349,10 @@ protected function buildBaseFieldDefinitions($entity_type_id) { if (!empty($module_definitions)) { // Ensure the provider key actually matches the name of the provider // defining the field. - foreach ($module_definitions as $definition) { + foreach ($module_definitions as $field_name => $definition) { $definition->setProvider($module); + $base_field_definitions[$field_name] = $definition; } - $base_field_definitions = NestedArray::mergeDeep($base_field_definitions, $module_definitions); } } @@ -436,10 +436,10 @@ protected function buildBundleFieldDefinitions($entity_type_id, $bundle, array $ if (!empty($module_definitions)) { // Ensure the provider key actually matches the name of the provider // defining the field. - foreach ($module_definitions as $definition) { + foreach ($module_definitions as $field_name => $definition) { $definition->setProvider($module); + $bundle_field_definitions[$field_name] = $definition; } - $bundle_field_definitions = NestedArray::mergeDeep($bundle_field_definitions, $module_definitions); } } diff --git a/core/lib/Drupal/Core/Field/FieldDefinition.php b/core/lib/Drupal/Core/Field/FieldDefinition.php index 5321836..6cfec74 100644 --- a/core/lib/Drupal/Core/Field/FieldDefinition.php +++ b/core/lib/Drupal/Core/Field/FieldDefinition.php @@ -156,7 +156,12 @@ public function getProvider() { } /** - * {@inheritdoc} + * Sets the name of the provider of this field. + * + * @param string $provider + * The provider name to set. + * + * @return $this */ public function setProvider($provider) { $this->definition['provider'] = $provider; @@ -472,8 +477,8 @@ public function hasCustomStorage() { * Sets the storage behavior for this field. * * @param bool $custom_storage - * Pass TRUE if the field module will take care of storing field values, - * FALSE otherwise. + * Pass FALSE if the storage controller takes care of storing the field, + * TRUE otherwise. * * @return $this */ diff --git a/core/lib/Drupal/Core/Field/FieldDefinitionInterface.php b/core/lib/Drupal/Core/Field/FieldDefinitionInterface.php index 966ba8e..b0eab20 100644 --- a/core/lib/Drupal/Core/Field/FieldDefinitionInterface.php +++ b/core/lib/Drupal/Core/Field/FieldDefinitionInterface.php @@ -107,21 +107,11 @@ public function getSetting($setting_name); * Returns the name of the provider of this field. * * @return string - * The module name. + * The provider name; e.g., the module name. */ public function getProvider(); /** - * Sets the name of the provider of this field. - * - * @param string $provider - * The provider name. - * - * @return $this - */ - public function setProvider($provider); - - /** * Returns whether the field is translatable. * * @return bool @@ -350,11 +340,11 @@ public function getColumns(); * Returns the storage behavior for this field. * * Indicates whether the entity type's storage controller should take care of - * storing the field values or whether the module providing the field will do - * that. + * storing the field values or whether it is handled separately; e.g. by the + * module providing the field. * * @return bool - * TRUE if the field module takes care of storing field values, FALSE + * FALSE if the storage controller takes care of storing the field, TRUE * otherwise. */ public function hasCustomStorage(); diff --git a/core/modules/field/lib/Drupal/field/Entity/FieldConfig.php b/core/modules/field/lib/Drupal/field/Entity/FieldConfig.php index 545ef86..971e246 100644 --- a/core/modules/field/lib/Drupal/field/Entity/FieldConfig.php +++ b/core/modules/field/lib/Drupal/field/Entity/FieldConfig.php @@ -590,14 +590,6 @@ public function getProvider() { /** * {@inheritdoc} */ - public function setProvider($provider) { - // Do nothing: provider is a readonly property here. - return $this; - } - - /** - * {@inheritdoc} - */ public function getLabel() { return $this->label(); } diff --git a/core/modules/field/lib/Drupal/field/Entity/FieldInstanceConfig.php b/core/modules/field/lib/Drupal/field/Entity/FieldInstanceConfig.php index 0bf3a92..e249355 100644 --- a/core/modules/field/lib/Drupal/field/Entity/FieldInstanceConfig.php +++ b/core/modules/field/lib/Drupal/field/Entity/FieldInstanceConfig.php @@ -508,14 +508,6 @@ public function getProvider() { /** * {@inheritdoc} */ - public function setProvider($provider) { - $this->field->setProvider($provider); - return $this; - } - - /** - * {@inheritdoc} - */ public function isTranslatable() { return $this->field->translatable; }