public function Contact::setOwner in Examples for Developers 8
Same name and namespace in other branches
- 3.x modules/content_entity_example/src/Entity/Contact.php \Drupal\content_entity_example\Entity\Contact::setOwner()
Sets the entity owner's user entity.
Parameters
\Drupal\user\UserInterface $account: The owner user entity.
Return value
$this
Overrides EntityOwnerInterface::setOwner
File
- content_entity_example/
src/ Entity/ Contact.php, line 180
Class
- Contact
- Defines the ContentEntityExample entity.
Namespace
Drupal\content_entity_example\EntityCode
public function setOwner(UserInterface $account) {
$this
->set('user_id', $account
->id());
return $this;
}