Commit f8fd7647 authored by alexpott's avatar alexpott

Issue #2705433 by timmillwood: Node should implement RevisionLogInterface

parent 0d9f0580
......@@ -311,6 +311,13 @@ public function setRevisionCreationTime($timestamp) {
* {@inheritdoc}
*/
public function getRevisionAuthor() {
return $this->getRevisionUser();
}
/**
* {@inheritdoc}
*/
public function getRevisionUser() {
return $this->get('revision_uid')->entity;
}
......@@ -318,7 +325,45 @@ public function getRevisionAuthor() {
* {@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;
}
......
......@@ -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,9 @@ 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. Use
* \Drupal\Core\Entity\RevisionLogInterface::getRevisionUser() instead.
*/
public function getRevisionAuthor();
......@@ -151,6 +155,9 @@ 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. Use
* \Drupal\Core\Entity\RevisionLogInterface::setRevisionUserId() instead.
*/
public function setRevisionAuthorId($uid);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment