You are here

public function Mentions::setOwner in Open Social 10.1.x

Same name and namespace in other branches
  1. 8.9 modules/custom/mentions/src/Entity/Mentions.php \Drupal\mentions\Entity\Mentions::setOwner()
  2. 8.5 modules/custom/mentions/src/Entity/Mentions.php \Drupal\mentions\Entity\Mentions::setOwner()
  3. 8.6 modules/custom/mentions/src/Entity/Mentions.php \Drupal\mentions\Entity\Mentions::setOwner()
  4. 8.7 modules/custom/mentions/src/Entity/Mentions.php \Drupal\mentions\Entity\Mentions::setOwner()
  5. 8.8 modules/custom/mentions/src/Entity/Mentions.php \Drupal\mentions\Entity\Mentions::setOwner()
  6. 10.3.x modules/custom/mentions/src/Entity/Mentions.php \Drupal\mentions\Entity\Mentions::setOwner()
  7. 10.0.x modules/custom/mentions/src/Entity/Mentions.php \Drupal\mentions\Entity\Mentions::setOwner()
  8. 10.2.x modules/custom/mentions/src/Entity/Mentions.php \Drupal\mentions\Entity\Mentions::setOwner()

Sets the entity owner's user entity.

Parameters

\Drupal\user\UserInterface $account: The owner user entity.

Return value

$this

Overrides EntityOwnerInterface::setOwner

File

modules/custom/mentions/src/Entity/Mentions.php, line 120

Class

Mentions
Mentions Class.

Namespace

Drupal\mentions\Entity

Code

public function setOwner(UserInterface $account) {
  $this
    ->set('auid', $account
    ->id());
  return $this;
}