public Node::setOwner(UserInterface $account)
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 285
Class
- Node
- Defines the node entity class.
Namespace
Drupal\node\Entity
Code
public function setOwner(UserInterface $account) { $this->set('uid', $account->id()); return $this; }
Please login to continue.