diff --git a/core/lib/Drupal/Core/Field/FieldConfigBase.php b/core/lib/Drupal/Core/Field/FieldConfigBase.php index 9813bb8..fa34ca3 100644 --- a/core/lib/Drupal/Core/Field/FieldConfigBase.php +++ b/core/lib/Drupal/Core/Field/FieldConfigBase.php @@ -302,49 +302,6 @@ public function postSave(EntityStorageInterface $storage, $update = TRUE) { /** * {@inheritdoc} */ - public function getSettings() { - return $this->settings + $this->getFieldStorageDefinition()->getSettings(); - } - - /** - * {@inheritdoc} - */ - public function getSetting($setting_name) { - if (array_key_exists($setting_name, $this->settings)) { - return $this->settings[$setting_name]; - } - else { - return $this->getFieldStorageDefinition()->getSetting($setting_name); - } - } - - /** - * {@inheritdoc} - */ - public function isTranslatable() { - // A field can be enabled for translation only if translation is supported. - return $this->translatable && $this->getFieldStorageDefinition()->isTranslatable(); - } - - /** - * {@inheritdoc} - */ - public function setTranslatable($translatable) { - $this->translatable = $translatable; - return $this; - } - - /** - * {@inheritdoc} - */ - public function setLabel($label) { - $this->label = $label; - return $this; - } - - /** - * {@inheritdoc} - */ public function getLabel() { return $this->label(); } @@ -352,6 +309,14 @@ public function getLabel() { /** * {@inheritdoc} */ + public function setLabel($label) { + $this->label = $label; + return $this; + } + + /** + * {@inheritdoc} + */ public function getDescription() { return $this->description; } @@ -367,6 +332,56 @@ public function setDescription($description) { /** * {@inheritdoc} */ + public function isTranslatable() { + // A field can be enabled for translation only if translation is supported. + return $this->translatable && $this->getFieldStorageDefinition()->isTranslatable(); + } + + /** + * {@inheritdoc} + */ + public function setTranslatable($translatable) { + $this->translatable = $translatable; + return $this; + } + + /** + * {@inheritdoc} + */ + public function getSettings() { + return $this->settings + $this->getFieldStorageDefinition()->getSettings(); + } + + /** + * {@inheritdoc} + */ + public function setSettings(array $settings) { + $this->settings = $settings; + return $this; + } + + /** + * {@inheritdoc} + */ + public function getSetting($setting_name) { + if (array_key_exists($setting_name, $this->settings)) { + return $this->settings[$setting_name]; + } + else { + return $this->getFieldStorageDefinition()->getSetting($setting_name); + } + } + + /** + * {@inheritdoc} + */ + public function setSetting($setting_name, $value) { + $this->settings[$setting_name] = $value; + } + + /** + * {@inheritdoc} + */ public function isRequired() { return $this->required; } @@ -556,19 +571,4 @@ public function addPropertyConstraints($name, array $constraints) { return $this; } - /** - * {@inheritdoc} - */ - public function setSetting($setting_name, $value) { - $this->settings[$setting_name] = $value; - } - - /** - * {@inheritdoc} - */ - public function setSettings(array $settings) { - $this->settings = $settings; - return $this; - } - } diff --git a/core/lib/Drupal/Core/Field/FieldConfigInterface.php b/core/lib/Drupal/Core/Field/FieldConfigInterface.php index e77ea40..ae45a21 100644 --- a/core/lib/Drupal/Core/Field/FieldConfigInterface.php +++ b/core/lib/Drupal/Core/Field/FieldConfigInterface.php @@ -55,13 +55,26 @@ public function setDescription($description); public function setTranslatable($translatable); /** - * Allows a bundle to be renamed. + * Sets field settings (overwrites existing settings). * - * Renaming a bundle on the instance is allowed when an entity's bundle - * is renamed and when field_entity_bundle_rename() does internal - * housekeeping. + * @param array $settings + * The array of field settings. + * + * @return $this + */ + public function setSettings(array $settings); + + /** + * Sets the value for a field setting by name. + * + * @param string $setting_name + * The name of the setting. + * @param mixed $value + * The value of the setting. + * + * @return $this */ - public function allowBundleRename(); + public function setSetting($setting_name, $value); /** * Sets a default value. @@ -205,25 +218,12 @@ public function addConstraint($constraint_name, $options = NULL); public function setConstraints(array $constraints); /** - * Sets the value for a field setting by name. + * Allows a bundle to be renamed. * - * @param string $setting_name - * The name of the setting. - * @param mixed $value - * The value of the setting. - * - * @return $this - */ - public function setSetting($setting_name, $value); - - /** - * Sets field settings (overwrites existing settings). - * - * @param array $settings - * The array of field settings. - * - * @return $this + * Renaming a bundle on the instance is allowed when an entity's bundle + * is renamed and when field_entity_bundle_rename() does internal + * housekeeping. */ - public function setSettings(array $settings); + public function allowBundleRename(); }