diff --git a/core/modules/node/src/Entity/Node.php b/core/modules/node/src/Entity/Node.php index fa6b5a3..98c6ee0 100644 --- a/core/modules/node/src/Entity/Node.php +++ b/core/modules/node/src/Entity/Node.php @@ -317,6 +317,13 @@ public function getRevisionAuthor() { /** * {@inheritdoc} */ + public function getRevisionUser() { + return $this->get('revision_uid')->entity; + } + + /** + * {@inheritdoc} + */ public function setRevisionAuthorId($uid) { $this->set('revision_uid', $uid); return $this; @@ -325,6 +332,44 @@ public function setRevisionAuthorId($uid) { /** * {@inheritdoc} */ + public function setRevisionUser(UserInterface $user) { + $this->set('revision_uid', $user); + return $this; + } + + /** + * {@inheritdoc} + */ + public function getRevisionUserId() { + return $this->get('revision_uid')->entity->id(); + } + + /** + * {@inheritdoc} + */ + public function setRevisionUserId($user_id) { + $this->set('revision_uid', $user_id); + return $this; + } + + /** + * {@inheritdoc} + */ + public function getRevisionLogMessage() { + return $this->get('revision_log')->value; + } + + /** + * {@inheritdoc} + */ + public function setRevisionLogMessage($revision_log_message) { + $this->set('revision_log', $revision_log_message); + return $this; + } + + /** + * {@inheritdoc} + */ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) { $fields = parent::baseFieldDefinitions($entity_type); diff --git a/core/modules/node/src/NodeInterface.php b/core/modules/node/src/NodeInterface.php index 654c00e..ae554ab 100644 --- a/core/modules/node/src/NodeInterface.php +++ b/core/modules/node/src/NodeInterface.php @@ -2,6 +2,7 @@ namespace Drupal\node; +use Drupal\Core\Entity\RevisionLogInterface; use Drupal\user\EntityOwnerInterface; use Drupal\Core\Entity\EntityChangedInterface; use Drupal\Core\Entity\ContentEntityInterface; @@ -9,7 +10,7 @@ /** * Provides an interface defining a node entity. */ -interface NodeInterface extends ContentEntityInterface, EntityChangedInterface, EntityOwnerInterface { +interface NodeInterface extends ContentEntityInterface, EntityChangedInterface, EntityOwnerInterface, RevisionLogInterface { /** * Gets the node type. @@ -140,6 +141,8 @@ public function setRevisionCreationTime($timestamp); * * @return \Drupal\user\UserInterface * The user entity for the revision author. + * + * @deprecated in Drupal 8.2.0, will be removed before Drupal 9.0.0. */ public function getRevisionAuthor(); @@ -151,6 +154,8 @@ public function getRevisionAuthor(); * * @return \Drupal\node\NodeInterface * The called node entity. + * + * @deprecated in Drupal 8.2.0, will be removed before Drupal 9.0.0. */ public function setRevisionAuthorId($uid);