comparison core/modules/node/src/NodeInterface.php @ 0:4c8ae668cc8c

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