HeartbeatStreamStorageInterface.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. namespace Drupal\heartbeat;
  3. use Drupal\Core\Entity\ContentEntityStorageInterface;
  4. use Drupal\Core\Session\AccountInterface;
  5. use Drupal\Core\Language\LanguageInterface;
  6. use Drupal\heartbeat\Entity\HeartbeatStreamInterface;
  7. /**
  8. * Defines the storage handler class for Heartbeat stream entities.
  9. *
  10. * This extends the base storage class, adding required special handling for
  11. * Heartbeat stream entities.
  12. *
  13. * @ingroup heartbeat
  14. */
  15. interface HeartbeatStreamStorageInterface extends ContentEntityStorageInterface {
  16. /**
  17. * Gets a list of Heartbeat stream revision IDs for a specific Heartbeat stream.
  18. *
  19. * @param \Drupal\heartbeat\Entity\HeartbeatStreamInterface $entity
  20. * The Heartbeat stream entity.
  21. *
  22. * @return int[]
  23. * Heartbeat stream revision IDs (in ascending order).
  24. */
  25. public function revisionIds(HeartbeatStreamInterface $entity);
  26. /**
  27. * Gets a list of revision IDs having a given user as Heartbeat stream author.
  28. *
  29. * @param \Drupal\Core\Session\AccountInterface $account
  30. * The user entity.
  31. *
  32. * @return int[]
  33. * Heartbeat stream revision IDs (in ascending order).
  34. */
  35. public function userRevisionIds(AccountInterface $account);
  36. /**
  37. * Counts the number of revisions in the default language.
  38. *
  39. * @param \Drupal\heartbeat\Entity\HeartbeatStreamInterface $entity
  40. * The Heartbeat stream entity.
  41. *
  42. * @return int
  43. * The number of revisions in the default language.
  44. */
  45. public function countDefaultLanguageRevisions(HeartbeatStreamInterface $entity);
  46. /**
  47. * Unsets the language for all Heartbeat stream with the given language.
  48. *
  49. * @param \Drupal\Core\Language\LanguageInterface $language
  50. * The language object.
  51. */
  52. public function clearRevisionsLanguage(LanguageInterface $language);
  53. }