function EntityOwnerTrait::setOwner
Same name in other branches
- 8.9.x core/modules/user/src/EntityOwnerTrait.php \Drupal\user\EntityOwnerTrait::setOwner()
- 10 core/modules/user/src/EntityOwnerTrait.php \Drupal\user\EntityOwnerTrait::setOwner()
- 11.x core/modules/user/src/EntityOwnerTrait.php \Drupal\user\EntityOwnerTrait::setOwner()
File
-
core/
modules/ user/ src/ EntityOwnerTrait.php, line 73
Class
- EntityOwnerTrait
- Provides a trait for entities that have an owner.
Namespace
Drupal\userCode
public function setOwner(UserInterface $account) {
$key = $this->getEntityType()
->getKey('owner');
$this->set($key, $account);
return $this;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.