summaryrefslogtreecommitdiffstats
path: root/core/modules/node/src/Entity/Node.php
diff options
context:
space:
mode:
authorAlex Pott2016-05-04 09:37:35 +0100
committerAlex Pott2016-05-04 09:37:35 +0100
commitf8fd764711af731a920269405275934c7ce5cee9 (patch)
treea3418ee0c7737afb8c19740ec1cdb738376702bc /core/modules/node/src/Entity/Node.php
parent0d9f0580f4065a302411f0a6c9174267e64f731c (diff)
Issue #2705433 by timmillwood: Node should implement RevisionLogInterface
Diffstat (limited to 'core/modules/node/src/Entity/Node.php')
-rw-r--r--core/modules/node/src/Entity/Node.php47
1 files changed, 46 insertions, 1 deletions
diff --git a/core/modules/node/src/Entity/Node.php b/core/modules/node/src/Entity/Node.php
index fa6b5a3..0fb327d 100644
--- a/core/modules/node/src/Entity/Node.php
+++ b/core/modules/node/src/Entity/Node.php
@@ -311,6 +311,13 @@ class Node extends ContentEntityBase implements NodeInterface {
* {@inheritdoc}
*/
public function getRevisionAuthor() {
+ return $this->getRevisionUser();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getRevisionUser() {
return $this->get('revision_uid')->entity;
}
@@ -318,7 +325,45 @@ class Node extends ContentEntityBase implements NodeInterface {
* {@inheritdoc}
*/
public function setRevisionAuthorId($uid) {
- $this->set('revision_uid', $uid);
+ $this->setRevisionUserId($uid);
+ return $this;
+ }
+
+ /**
+ * {@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;
}