function RevisionLogEntityTrait::setRevisionUserId

Same name in other branches
  1. 8.9.x core/lib/Drupal/Core/Entity/RevisionLogEntityTrait.php \Drupal\Core\Entity\RevisionLogEntityTrait::setRevisionUserId()
  2. 10 core/lib/Drupal/Core/Entity/RevisionLogEntityTrait.php \Drupal\Core\Entity\RevisionLogEntityTrait::setRevisionUserId()
  3. 11.x core/lib/Drupal/Core/Entity/RevisionLogEntityTrait.php \Drupal\Core\Entity\RevisionLogEntityTrait::setRevisionUserId()

Implements \Drupal\Core\Entity\RevisionLogInterface::setRevisionUserId().

1 call to RevisionLogEntityTrait::setRevisionUserId()
Node::preSave in core/modules/node/src/Entity/Node.php
Acts on an entity before the presave hook is invoked.
1 method overrides RevisionLogEntityTrait::setRevisionUserId()
BlockContent::setRevisionUserId in core/modules/block_content/src/Entity/BlockContent.php
Implements \Drupal\Core\Entity\RevisionLogInterface::setRevisionUserId().

File

core/lib/Drupal/Core/Entity/RevisionLogEntityTrait.php, line 106

Class

RevisionLogEntityTrait
Provides a trait for accessing revision logging and ownership information.

Namespace

Drupal\Core\Entity

Code

public function setRevisionUserId($user_id) {
    $this->{$this->getEntityType()
        ->getRevisionMetadataKey('revision_user')}->target_id = $user_id;
    return $this;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.