diff --git a/core/modules/language/config/schema/language.schema.yml b/core/modules/language/config/schema/language.schema.yml index ef6cb5a..9a13f38 100644 --- a/core/modules/language/config/schema/language.schema.yml +++ b/core/modules/language/config/schema/language.schema.yml @@ -108,7 +108,7 @@ language.content_settings.*.*: id: type: string label: 'ID' - entity_type: + target_entity_type_id: type: string label: 'Entity Type ID' bundle: diff --git a/core/modules/language/src/Entity/ContentLanguageSettings.php b/core/modules/language/src/Entity/ContentLanguageSettings.php index a93a892..8032432 100644 --- a/core/modules/language/src/Entity/ContentLanguageSettings.php +++ b/core/modules/language/src/Entity/ContentLanguageSettings.php @@ -35,11 +35,11 @@ class ContentLanguageSettings extends ConfigEntityBase { protected $id; /** - * The entity type (machine name). + * The entity type ID (machine name). * * @var string */ - protected $entity_type; + protected $target_entity_type_id; /** * The bundle (machine name). @@ -66,7 +66,24 @@ class ContentLanguageSettings extends ConfigEntityBase { * {@inheritdoc} */ public function id() { - return $this->entity_type . '.' . $this->bundle; + return $this->target_entity_type_id . '.' . $this->bundle; + } + + /** + * Gets the entity type ID this config applies to. + * + * @return string + */ + public function getTargetEntityTypeId() { + return $this->target_entity_type_id; + } + + /** + * Gets the bundle this config applies to. + * @return string + */ + public function getBundle() { + return $this->bundle; } /** @@ -148,7 +165,7 @@ public function differsFromDefaultConfiguration() { public static function loadByEntityTypeBundle($entity_type_id, $bundle) { $config = \Drupal::entityManager()->getStorage('language_content_settings')->load($entity_type_id . '.' . $bundle); if ($config == NULL) { - $config = ContentLanguageSettings::create(['entity_type' => $entity_type_id, 'bundle' => $bundle]); + $config = ContentLanguageSettings::create(['target_entity_type_id' => $entity_type_id, 'bundle' => $bundle]); } return $config; } diff --git a/core/modules/language/src/Form/ContentLanguageSettingsForm.php b/core/modules/language/src/Form/ContentLanguageSettingsForm.php index a381ee1..af7aa41 100644 --- a/core/modules/language/src/Form/ContentLanguageSettingsForm.php +++ b/core/modules/language/src/Form/ContentLanguageSettingsForm.php @@ -11,7 +11,6 @@ use Drupal\Core\Entity\EntityManagerInterface; use Drupal\Core\Form\ConfigFormBase; use Drupal\Core\Form\FormStateInterface; -use Drupal\Core\Language\LanguageInterface; use Drupal\language\Entity\ContentLanguageSettings; use Symfony\Component\DependencyInjection\ContainerInterface;