diff --git a/core/lib/Drupal/Core/Config/Entity/ConfigEntityType.php b/core/lib/Drupal/Core/Config/Entity/ConfigEntityType.php index 43d62d3..5e149b8 100644 --- a/core/lib/Drupal/Core/Config/Entity/ConfigEntityType.php +++ b/core/lib/Drupal/Core/Config/Entity/ConfigEntityType.php @@ -77,7 +77,7 @@ public function getKeys() { // Always add default 'uuid' and 'language' keys. return array( 'uuid' => 'uuid', - 'language' => 'langcode', + 'langcode' => 'langcode', ) + parent::getKeys(); } diff --git a/core/lib/Drupal/Core/Entity/Entity.php b/core/lib/Drupal/Core/Entity/Entity.php index 5f51fe7..a8cb195 100644 --- a/core/lib/Drupal/Core/Entity/Entity.php +++ b/core/lib/Drupal/Core/Entity/Entity.php @@ -296,13 +296,6 @@ public function language() { /** * {@inheritdoc} */ - public function langcode() { - return $this->language()->id; - } - - /** - * {@inheritdoc} - */ public function save() { return $this->entityManager()->getStorage($this->entityTypeId)->save($this); } diff --git a/core/lib/Drupal/Core/Entity/EntityInterface.php b/core/lib/Drupal/Core/Entity/EntityInterface.php index bb1d459..90e4699 100644 --- a/core/lib/Drupal/Core/Entity/EntityInterface.php +++ b/core/lib/Drupal/Core/Entity/EntityInterface.php @@ -43,14 +43,6 @@ public function id(); public function language(); /** - * Returns the language code of the entity. - * - * @return string - * The language code. - */ - public function langcode(); - - /** * Returns whether the entity is new. * * Usually an entity is new if no ID exists for it yet. However, entities may diff --git a/core/lib/Drupal/Core/Entity/EntityStorageBase.php b/core/lib/Drupal/Core/Entity/EntityStorageBase.php index a400c5f..017842e 100644 --- a/core/lib/Drupal/Core/Entity/EntityStorageBase.php +++ b/core/lib/Drupal/Core/Entity/EntityStorageBase.php @@ -81,7 +81,7 @@ public function __construct(EntityTypeInterface $entity_type) { $this->idKey = $this->entityType->getKey('id'); $this->uuidKey = $this->entityType->getKey('uuid'); - $this->languageKey = $this->entityType->getKey('language'); + $this->languageKey = $this->entityType->getKey('langcode'); } /** diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Entity/Feed.php b/core/modules/aggregator/lib/Drupal/aggregator/Entity/Feed.php index 313e624..bf0357c 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Entity/Feed.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Entity/Feed.php @@ -40,7 +40,7 @@ * entity_keys = { * "id" = "fid", * "uuid" = "uuid", - * "language" = "langcode", + * "langcode" = "langcode", * "label" = "title", * } * ) diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Entity/Item.php b/core/modules/aggregator/lib/Drupal/aggregator/Entity/Item.php index e74b3b8..3db4089 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Entity/Item.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Entity/Item.php @@ -27,7 +27,7 @@ * fieldable = TRUE, * entity_keys = { * "id" = "iid", - * "language" = "langcode", + * "langcode" = "langcode", * "label" = "title", * } * ) diff --git a/core/tests/Drupal/Tests/Core/Entity/EntityManagerTest.php b/core/tests/Drupal/Tests/Core/Entity/EntityManagerTest.php index 9ad4bc0..67fc894 100644 --- a/core/tests/Drupal/Tests/Core/Entity/EntityManagerTest.php +++ b/core/tests/Drupal/Tests/Core/Entity/EntityManagerTest.php @@ -544,7 +544,7 @@ public function testGetFieldDefinitionsWithCaching() { * @expectedException \LogicException */ public function testGetBaseFieldDefinitionsInvalidDefinition() { - $langcode_definition = $this->setUpEntityWithFieldDefinition(FALSE, 'langcode', 1, array('language' => 'langcode')); + $langcode_definition = $this->setUpEntityWithFieldDefinition(FALSE, 'langcode', 1, array('langcode' => 'langcode')); $langcode_definition->expects($this->once()) ->method('isTranslatable') ->will($this->returnValue(TRUE));