function AssignOwnerNode::execute
Executes the plugin.
Overrides ExecutableInterface::execute
File
-
core/
modules/ action/ src/ Plugin/ Action/ AssignOwnerNode.php, line 64
Class
- AssignOwnerNode
- Assigns ownership of a node to a user.
Namespace
Drupal\action\Plugin\ActionCode
public function execute($entity = NULL) {
/** @var \Drupal\node\NodeInterface $entity */
$entity->setOwnerId($this->configuration['owner_uid'])
->save();
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.