public function AssignOwnerNode::execute

Executes the plugin.

Overrides ExecutableInterface::execute

File

drupal/core/modules/node/lib/Drupal/node/Plugin/Action/AssignOwnerNode.php, line 64
Contains \Drupal\node\Plugin\Action\AssignOwnerNode.

Class

AssignOwnerNode
Assigns ownership of a node to a user.

Namespace

Drupal\node\Plugin\Action

Code

public function execute($entity = NULL) {
  $entity->uid = $this->configuration['owner_uid'];
  $entity
    ->save();
}