annotate core/modules/node/src/NodeInterface.php @ 19:fa3358dc1485 tip

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