NodeInterface.php 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. <?php
  2. namespace Drupal\node;
  3. use Drupal\Core\Entity\EntityPublishedInterface;
  4. use Drupal\Core\Entity\RevisionLogInterface;
  5. use Drupal\user\EntityOwnerInterface;
  6. use Drupal\Core\Entity\EntityChangedInterface;
  7. use Drupal\Core\Entity\ContentEntityInterface;
  8. /**
  9. * Provides an interface defining a node entity.
  10. */
  11. interface NodeInterface extends ContentEntityInterface, EntityChangedInterface, EntityOwnerInterface, RevisionLogInterface, EntityPublishedInterface {
  12. /**
  13. * Denotes that the node is not published.
  14. */
  15. const NOT_PUBLISHED = 0;
  16. /**
  17. * Denotes that the node is published.
  18. */
  19. const PUBLISHED = 1;
  20. /**
  21. * Denotes that the node is not promoted to the front page.
  22. */
  23. const NOT_PROMOTED = 0;
  24. /**
  25. * Denotes that the node is promoted to the front page.
  26. */
  27. const PROMOTED = 1;
  28. /**
  29. * Denotes that the node is not sticky at the top of the page.
  30. */
  31. const NOT_STICKY = 0;
  32. /**
  33. * Denotes that the node is sticky at the top of the page.
  34. */
  35. const STICKY = 1;
  36. /**
  37. * Gets the node type.
  38. *
  39. * @return string
  40. * The node type.
  41. */
  42. public function getType();
  43. /**
  44. * Gets the node title.
  45. *
  46. * @return string
  47. * Title of the node.
  48. */
  49. public function getTitle();
  50. /**
  51. * Sets the node title.
  52. *
  53. * @param string $title
  54. * The node title.
  55. *
  56. * @return \Drupal\node\NodeInterface
  57. * The called node entity.
  58. */
  59. public function setTitle($title);
  60. /**
  61. * Gets the node creation timestamp.
  62. *
  63. * @return int
  64. * Creation timestamp of the node.
  65. */
  66. public function getCreatedTime();
  67. /**
  68. * Sets the node creation timestamp.
  69. *
  70. * @param int $timestamp
  71. * The node creation timestamp.
  72. *
  73. * @return \Drupal\node\NodeInterface
  74. * The called node entity.
  75. */
  76. public function setCreatedTime($timestamp);
  77. /**
  78. * Returns the node promotion status.
  79. *
  80. * @return bool
  81. * TRUE if the node is promoted.
  82. */
  83. public function isPromoted();
  84. /**
  85. * Sets the node promoted status.
  86. *
  87. * @param bool $promoted
  88. * TRUE to set this node to promoted, FALSE to set it to not promoted.
  89. *
  90. * @return \Drupal\node\NodeInterface
  91. * The called node entity.
  92. */
  93. public function setPromoted($promoted);
  94. /**
  95. * Returns the node sticky status.
  96. *
  97. * @return bool
  98. * TRUE if the node is sticky.
  99. */
  100. public function isSticky();
  101. /**
  102. * Sets the node sticky status.
  103. *
  104. * @param bool $sticky
  105. * TRUE to set this node to sticky, FALSE to set it to not sticky.
  106. *
  107. * @return \Drupal\node\NodeInterface
  108. * The called node entity.
  109. */
  110. public function setSticky($sticky);
  111. /**
  112. * Gets the node revision creation timestamp.
  113. *
  114. * @return int
  115. * The UNIX timestamp of when this revision was created.
  116. */
  117. public function getRevisionCreationTime();
  118. /**
  119. * Sets the node revision creation timestamp.
  120. *
  121. * @param int $timestamp
  122. * The UNIX timestamp of when this revision was created.
  123. *
  124. * @return \Drupal\node\NodeInterface
  125. * The called node entity.
  126. */
  127. public function setRevisionCreationTime($timestamp);
  128. /**
  129. * Gets the node revision author.
  130. *
  131. * @return \Drupal\user\UserInterface
  132. * The user entity for the revision author.
  133. *
  134. * @deprecated in Drupal 8.2.0, will be removed before Drupal 9.0.0. Use
  135. * \Drupal\Core\Entity\RevisionLogInterface::getRevisionUser() instead.
  136. */
  137. public function getRevisionAuthor();
  138. /**
  139. * Sets the node revision author.
  140. *
  141. * @param int $uid
  142. * The user ID of the revision author.
  143. *
  144. * @return \Drupal\node\NodeInterface
  145. * The called node entity.
  146. *
  147. * @deprecated in Drupal 8.2.0, will be removed before Drupal 9.0.0. Use
  148. * \Drupal\Core\Entity\RevisionLogInterface::setRevisionUserId() instead.
  149. */
  150. public function setRevisionAuthorId($uid);
  151. }