diff --git a/core/modules/field/src/Entity/FieldConfig.php b/core/modules/field/src/Entity/FieldConfig.php index a50d92f..e56aa06 100644 --- a/core/modules/field/src/Entity/FieldConfig.php +++ b/core/modules/field/src/Entity/FieldConfig.php @@ -469,7 +469,7 @@ public function getSchema() { // Merge custom indexes with those specified by the field type. Custom // indexes prevail. - $schema['indexes'] = $this->getIndexes() + $schema['indexes']; + $schema['indexes'] = $this->indexes + $schema['indexes']; $this->schema = $schema; } @@ -520,12 +520,7 @@ public function getName() { } /** - * Sets the field config indexes. - * - * @param array $indexes - * The field config indexes. - * - * @return $this + * {@inheritdoc} */ public function setIndexes(array $indexes) { $this->set('indexes', $indexes); @@ -533,22 +528,7 @@ public function setIndexes(array $indexes) { } /** - * Returns the indexes array of the field config. - * - * @return array - * The indexes array. - */ - public function getIndexes() { - return $this->indexes; - } - - /** - * Sets the field config deleted property. - * - * @param bool $deleted - * The field config deleted property. - * - * @return $this + * {@inheritdoc} */ public function setDeleted($deleted) { $this->set('deleted', $deleted); @@ -556,20 +536,14 @@ public function setDeleted($deleted) { } /** - * Returns the deleted property of the field config. - * - * @return bool - * The deleted property. + * {@inheritdoc} */ public function isDeleted() { return $this->deleted; } /** - * Returns the name of the module providing the field type. - * - * @return string - * The name of the module that provides the field type. + * {@inheritdoc} */ public function getModule() { return $this->module; @@ -616,14 +590,7 @@ public function getSetting($setting_name) { } /** - * Sets the value for a field setting. - * - * @param string $setting_name - * The name of the setting. - * @param mixed $value - * The value of the setting. - * - * @return $this + * {@inheritdoc} */ public function setSetting($setting_name, $value) { $this->settings[$setting_name] = $value; @@ -631,12 +598,7 @@ public function setSetting($setting_name, $value) { } /** - * Sets field settings. - * - * @param string $settings - * The array of field settings. - * - * @return $this + * {@inheritdoc} */ public function setSettings($settings) { $this->set('settings', $settings); @@ -659,12 +621,7 @@ public function isRevisionable() { } /** - * Sets whether the field is translatable. - * - * @param bool $translatable - * Whether the field is translatable. - * - * @return $this + * {@inheritdoc} */ public function setTranslatable($translatable) { $this->translatable = $translatable; @@ -700,12 +657,7 @@ public function getCardinality() { } /** - * Sets the maximum number of items allowed for the field. - * - * @param integer $cardinality - * The cardinality value. - * - * @return $this + * {@inheritdoc} */ public function setCardinality($cardinality) { $this->set('cardinality', $cardinality); @@ -735,12 +687,7 @@ public function isLocked() { } /** - * Sets the locked flag. - * - * @param bool $locked - * Sets value of locked flag - * - * @return $this + * {@inheritdoc} */ public function setLocked($locked) { $this->set('locked', $locked); @@ -748,19 +695,6 @@ public function setLocked($locked) { } /** - * Sets the entity type of the field config. - * - * @param string $entity_type - * The entity type. - * - * @return $this - */ - public function setTargetEntityTypeId($entity_type) { - $this->set('entity_type', $entity_type); - return $this; - } - - /** * {@inheritdoc} */ public function getTargetEntityTypeId() { diff --git a/core/modules/field/src/FieldConfigInterface.php b/core/modules/field/src/FieldConfigInterface.php index c6575ec..e302531 100644 --- a/core/modules/field/src/FieldConfigInterface.php +++ b/core/modules/field/src/FieldConfigInterface.php @@ -31,4 +31,92 @@ public function getBundles(); */ public function isLocked(); + /** + * Sets the locked flag. + * + * @param bool $locked + * Sets value of locked flag + * + * @return $this + */ + public function setLocked($locked); + + /** + * Returns whether the field is deleted or not. + * + * @return bool + * The deleted property. + */ + public function isDeleted(); + + /** + * Sets the field config deleted property. + * + * @param bool $deleted + * The field config deleted property. + * + * @return $this + */ + public function setDeleted($deleted); + +/** + * Sets the maximum number of items allowed for the field. + * + * @param integer $cardinality + * The cardinality value. + * + * @return $this + */ + public function setCardinality($cardinality); + + /** + * Sets the field config indexes. + * + * @param array $indexes + * The field config indexes. + * + * @return $this + */ + public function setIndexes(array $indexes); + + /** + * 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 setSetting($setting_name, $value); + +/** + * Sets field settings by overwriting the settings array. + * + * @param string $settings + * The array of field settings. + * + * @return $this + */ + public function setSettings($settings); + + /** + * Returns the name of the module providing the field type. + * + * @return string + * The name of the module that provides the field type. + */ + public function getModule(); + + /** + * Sets whether the field is translatable. + * + * @param bool $translatable + * Whether the field is translatable. + * + * @return $this + */ + public function setTranslatable($translatable); + }