diff --git a/core/lib/Drupal/Core/Config/Entity/ConfigEntityType.php b/core/lib/Drupal/Core/Config/Entity/ConfigEntityType.php index 7960edc272dac5fad0a6adf3141614b286067bf5..2b5dfd54342f038655bcea0d87dd156d9264f337 100644 --- a/core/lib/Drupal/Core/Config/Entity/ConfigEntityType.php +++ b/core/lib/Drupal/Core/Config/Entity/ConfigEntityType.php @@ -63,8 +63,11 @@ class ConfigEntityType extends EntityType { /** * {@inheritdoc} */ - public function getControllerClasses() { - return parent::getControllerClasses() + array( + public function __construct($definition) { + parent::__construct($definition); + // Always add a default 'uuid' key. + $this->entity_keys['uuid'] = 'uuid'; + $this->controllers += array( 'storage' => 'Drupal\Core\Config\Entity\ConfigEntityStorage', ); } @@ -94,15 +97,6 @@ public function getConfigPrefix() { return $config_prefix; } - /** - * {@inheritdoc} - */ - public function getKeys() { - // Always add a default 'uuid' key. - return array('uuid' => 'uuid') + parent::getKeys(); - } - - /** * {@inheritdoc} */ diff --git a/core/lib/Drupal/Core/Entity/ContentEntityType.php b/core/lib/Drupal/Core/Entity/ContentEntityType.php index f69f9017bc542040029efcd036ec78fb9fb9dcbf..4be18fe196e0199dc6a913b1f50295acdea1dfb4 100644 --- a/core/lib/Drupal/Core/Entity/ContentEntityType.php +++ b/core/lib/Drupal/Core/Entity/ContentEntityType.php @@ -15,8 +15,9 @@ class ContentEntityType extends EntityType implements ContentEntityTypeInterface /** * {@inheritdoc} */ - public function getControllerClasses() { - return parent::getControllerClasses() + array( + public function __construct($definition) { + parent::__construct($definition); + $this->controllers += array( 'storage' => 'Drupal\Core\Entity\ContentEntityDatabaseStorage', ); } diff --git a/core/lib/Drupal/Core/Entity/EntityType.php b/core/lib/Drupal/Core/Entity/EntityType.php index ac49238aeaa7a88917e0c82319f8b80ff01bfdf0..728b3ec34f0585b6520ea4c3271cbe15ea116253 100644 --- a/core/lib/Drupal/Core/Entity/EntityType.php +++ b/core/lib/Drupal/Core/Entity/EntityType.php @@ -217,6 +217,15 @@ public function __construct($definition) { foreach ($definition as $property => $value) { $this->{$property} = $value; } + + // Ensure defaults. + $this->entity_keys += array( + 'revision' => '', + 'bundle' => '' + ); + $this->controllers += array( + 'access' => 'Drupal\Core\Entity\EntityAccessController', + ); } /** @@ -259,7 +268,7 @@ public function isFieldDataCacheable() { * {@inheritdoc} */ public function getKeys() { - return $this->entity_keys + array('revision' => '', 'bundle' => ''); + return $this->entity_keys; } /** @@ -318,9 +327,7 @@ public function isSubclassOf($class) { * {@inheritdoc} */ public function getControllerClasses() { - return $this->controllers + array( - 'access' => 'Drupal\Core\Entity\EntityAccessController', - ); + return $this->controllers; } /**