KeyValueContentEntityStorage.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. namespace Drupal\Core\Entity\KeyValueStore;
  3. use Drupal\Core\Entity\ContentEntityInterface;
  4. use Drupal\Core\Entity\ContentEntityStorageInterface;
  5. use Drupal\Core\Entity\RevisionableInterface;
  6. use Drupal\Core\Entity\TranslatableInterface;
  7. /**
  8. * Provides a key value backend for content entities.
  9. */
  10. class KeyValueContentEntityStorage extends KeyValueEntityStorage implements ContentEntityStorageInterface {
  11. /**
  12. * {@inheritdoc}
  13. */
  14. public function createTranslation(ContentEntityInterface $entity, $langcode, array $values = []) {
  15. // @todo Complete the content entity storage implementation in
  16. // https://www.drupal.org/node/2618436.
  17. }
  18. /**
  19. * {@inheritdoc}
  20. */
  21. public function hasStoredTranslations(TranslatableInterface $entity) {
  22. return FALSE;
  23. }
  24. /**
  25. * {@inheritdoc}
  26. */
  27. public function createRevision(RevisionableInterface $entity, $default = TRUE, $keep_untranslatable_fields = NULL) {
  28. return NULL;
  29. }
  30. /**
  31. * {@inheritdoc}
  32. */
  33. public function createWithSampleValues($bundle = FALSE, array $values = []) {}
  34. /**
  35. * {@inheritdoc}
  36. */
  37. public function loadMultipleRevisions(array $revision_ids) {
  38. return [];
  39. }
  40. /**
  41. * {@inheritdoc}
  42. */
  43. public function getLatestRevisionId($entity_id) {
  44. return NULL;
  45. }
  46. /**
  47. * {@inheritdoc}
  48. */
  49. public function getLatestTranslationAffectedRevisionId($entity_id, $langcode) {
  50. return NULL;
  51. }
  52. }