5 use Drupal\Core\Entity\EntityPublishedInterface;
6 use Drupal\Core\Entity\RevisionLogInterface;
7 use Drupal\user\EntityOwnerInterface;
8 use Drupal\Core\Entity\EntityChangedInterface;
9 use Drupal\Core\Entity\ContentEntityInterface;
12 * Provides an interface defining a node entity.
14 interface NodeInterface extends ContentEntityInterface, EntityChangedInterface, EntityOwnerInterface, RevisionLogInterface, EntityPublishedInterface {
17 * Denotes that the node is not published.
19 const NOT_PUBLISHED = 0;
22 * Denotes that the node is published.
27 * Denotes that the node is not promoted to the front page.
29 const NOT_PROMOTED = 0;
32 * Denotes that the node is promoted to the front page.
37 * Denotes that the node is not sticky at the top of the page.
42 * Denotes that the node is sticky at the top of the page.
52 public function getType();
55 * Gets the node title.
60 public function getTitle();
63 * Sets the node title.
65 * @param string $title
68 * @return \Drupal\node\NodeInterface
69 * The called node entity.
71 public function setTitle($title);
74 * Gets the node creation timestamp.
77 * Creation timestamp of the node.
79 public function getCreatedTime();
82 * Sets the node creation timestamp.
84 * @param int $timestamp
85 * The node creation timestamp.
87 * @return \Drupal\node\NodeInterface
88 * The called node entity.
90 public function setCreatedTime($timestamp);
93 * Returns the node promotion status.
96 * TRUE if the node is promoted.
98 public function isPromoted();
101 * Sets the node promoted status.
103 * @param bool $promoted
104 * TRUE to set this node to promoted, FALSE to set it to not promoted.
106 * @return \Drupal\node\NodeInterface
107 * The called node entity.
109 public function setPromoted($promoted);
112 * Returns the node sticky status.
115 * TRUE if the node is sticky.
117 public function isSticky();
120 * Sets the node sticky status.
122 * @param bool $sticky
123 * TRUE to set this node to sticky, FALSE to set it to not sticky.
125 * @return \Drupal\node\NodeInterface
126 * The called node entity.
128 public function setSticky($sticky);
131 * Gets the node revision creation timestamp.
134 * The UNIX timestamp of when this revision was created.
136 public function getRevisionCreationTime();
139 * Sets the node revision creation timestamp.
141 * @param int $timestamp
142 * The UNIX timestamp of when this revision was created.
144 * @return \Drupal\node\NodeInterface
145 * The called node entity.
147 public function setRevisionCreationTime($timestamp);
150 * Gets the node revision author.
152 * @return \Drupal\user\UserInterface
153 * The user entity for the revision author.
155 * @deprecated in Drupal 8.2.0, will be removed before Drupal 9.0.0. Use
156 * \Drupal\Core\Entity\RevisionLogInterface::getRevisionUser() instead.
158 public function getRevisionAuthor();
161 * Sets the node revision author.
164 * The user ID of the revision author.
166 * @return \Drupal\node\NodeInterface
167 * The called node entity.
169 * @deprecated in Drupal 8.2.0, will be removed before Drupal 9.0.0. Use
170 * \Drupal\Core\Entity\RevisionLogInterface::setRevisionUserId() instead.
172 public function setRevisionAuthorId($uid);