NodeStorageInterface.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <?php
  2. namespace Drupal\node;
  3. use Drupal\Core\Entity\ContentEntityStorageInterface;
  4. use Drupal\Core\Language\LanguageInterface;
  5. use Drupal\Core\Session\AccountInterface;
  6. /**
  7. * Defines an interface for node entity storage classes.
  8. */
  9. interface NodeStorageInterface extends ContentEntityStorageInterface {
  10. /**
  11. * Gets a list of node revision IDs for a specific node.
  12. *
  13. * @param \Drupal\node\NodeInterface $node
  14. * The node entity.
  15. *
  16. * @return int[]
  17. * Node revision IDs (in ascending order).
  18. */
  19. public function revisionIds(NodeInterface $node);
  20. /**
  21. * Gets a list of revision IDs having a given user as node author.
  22. *
  23. * @param \Drupal\Core\Session\AccountInterface $account
  24. * The user entity.
  25. *
  26. * @return int[]
  27. * Node revision IDs (in ascending order).
  28. */
  29. public function userRevisionIds(AccountInterface $account);
  30. /**
  31. * Counts the number of revisions in the default language.
  32. *
  33. * @param \Drupal\node\NodeInterface $node
  34. * The node entity.
  35. *
  36. * @return int
  37. * The number of revisions in the default language.
  38. */
  39. public function countDefaultLanguageRevisions(NodeInterface $node);
  40. /**
  41. * Updates all nodes of one type to be of another type.
  42. *
  43. * @param string $old_type
  44. * The current node type of the nodes.
  45. * @param string $new_type
  46. * The new node type of the nodes.
  47. *
  48. * @return int
  49. * The number of nodes whose node type field was modified.
  50. */
  51. public function updateType($old_type, $new_type);
  52. /**
  53. * Unsets the language for all nodes with the given language.
  54. *
  55. * @param \Drupal\Core\Language\LanguageInterface $language
  56. * The language object.
  57. */
  58. public function clearRevisionsLanguage(LanguageInterface $language);
  59. }