diff --git a/core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php b/core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php index ca0cbdc01ac..723ba5316ee 100644 --- a/core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php +++ b/core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php @@ -132,13 +132,6 @@ class ConfigEntityStorage extends EntityStorageBase implements ConfigEntityStora return NULL; } - /** - * {@inheritdoc} - */ - public function loadMultipleRevisions(array $revision_ids) { - return []; - } - /** * {@inheritdoc} */ diff --git a/core/lib/Drupal/Core/Entity/ContentEntityStorageInterface.php b/core/lib/Drupal/Core/Entity/ContentEntityStorageInterface.php index eb979c7fd6a..678937bdc00 100644 --- a/core/lib/Drupal/Core/Entity/ContentEntityStorageInterface.php +++ b/core/lib/Drupal/Core/Entity/ContentEntityStorageInterface.php @@ -5,7 +5,7 @@ namespace Drupal\Core\Entity; /** * A storage that supports content entity types. */ -interface ContentEntityStorageInterface extends EntityStorageInterface { +interface ContentEntityStorageInterface extends EntityStorageInterface, RevisionableStorageInterface { /** * Constructs a new entity translation object, without permanently saving it. diff --git a/core/lib/Drupal/Core/Entity/EntityStorageInterface.php b/core/lib/Drupal/Core/Entity/EntityStorageInterface.php index 052988cbb1f..1db273945aa 100644 --- a/core/lib/Drupal/Core/Entity/EntityStorageInterface.php +++ b/core/lib/Drupal/Core/Entity/EntityStorageInterface.php @@ -79,21 +79,15 @@ interface EntityStorageInterface { * * @return \Drupal\Core\Entity\EntityInterface|null * The specified entity revision or NULL if not found. + * + * @todo Deprecated in Drupal 8.5.0 and will be removed before Drupal 9.0.0. + * Use \Drupal\Core\Entity\RevisionableStorageInterface instead. + * + * @see https://www.drupal.org/node/2926958 + * @see https://www.drupal.org/node/2927226 */ public function loadRevision($revision_id); - /** - * Loads multiple entity revisions. - * - * @param array $revision_ids - * An array of revision IDs to load. - * - * @return \Drupal\Core\Entity\EntityInterface[] - * An array of entity revisions keyed by their revision ID, or an empty - * array if none found. - */ - public function loadMultipleRevisions(array $revision_ids); - /** * Delete a specific entity revision. * @@ -101,6 +95,12 @@ interface EntityStorageInterface { * * @param int $revision_id * The revision id. + * + * @todo Deprecated in Drupal 8.5.0 and will be removed before Drupal 9.0.0. + * Use \Drupal\Core\Entity\RevisionableStorageInterface instead. + * + * @see https://www.drupal.org/node/2926958 + * @see https://www.drupal.org/node/2927226 */ public function deleteRevision($revision_id); diff --git a/core/lib/Drupal/Core/Entity/KeyValueStore/KeyValueContentEntityStorage.php b/core/lib/Drupal/Core/Entity/KeyValueStore/KeyValueContentEntityStorage.php index b3fc12d6b61..2c57405c19f 100644 --- a/core/lib/Drupal/Core/Entity/KeyValueStore/KeyValueContentEntityStorage.php +++ b/core/lib/Drupal/Core/Entity/KeyValueStore/KeyValueContentEntityStorage.php @@ -23,4 +23,11 @@ class KeyValueContentEntityStorage extends KeyValueEntityStorage implements Cont */ public function createWithSampleValues($bundle = FALSE, array $values = []) {} + /** + * {@inheritdoc} + */ + public function loadMultipleRevisions(array $revision_ids) { + return []; + } + } diff --git a/core/lib/Drupal/Core/Entity/KeyValueStore/KeyValueEntityStorage.php b/core/lib/Drupal/Core/Entity/KeyValueStore/KeyValueEntityStorage.php index fd542d96656..cd2f26efbd6 100644 --- a/core/lib/Drupal/Core/Entity/KeyValueStore/KeyValueEntityStorage.php +++ b/core/lib/Drupal/Core/Entity/KeyValueStore/KeyValueEntityStorage.php @@ -130,13 +130,6 @@ class KeyValueEntityStorage extends EntityStorageBase { return NULL; } - /** - * {@inheritdoc} - */ - public function loadMultipleRevisions(array $revision_ids) { - return []; - } - /** * {@inheritdoc} */ diff --git a/core/lib/Drupal/Core/Entity/RevisionableStorageInterface.php b/core/lib/Drupal/Core/Entity/RevisionableStorageInterface.php new file mode 100644 index 00000000000..871fcc5435f --- /dev/null +++ b/core/lib/Drupal/Core/Entity/RevisionableStorageInterface.php @@ -0,0 +1,43 @@ +