public function Node::setOwner in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/node/src/Entity/Node.php \Drupal\node\Entity\Node::setOwner()
Sets the entity owner's user entity.
Parameters
\Drupal\user\UserInterface $account: The owner user entity.
Return value
$this
Overrides EntityOwnerInterface::setOwner
File
- core/
modules/ node/ src/ Entity/ Node.php, line 286 - Contains \Drupal\node\Entity\Node.
Class
- Node
- Defines the node entity class.
Namespace
Drupal\node\EntityCode
public function setOwner(UserInterface $account) {
$this
->set('uid', $account
->id());
return $this;
}