You are here

public function OgMembership::getOwner in Organic groups 8

Returns the entity owner's user entity.

Return value

\Drupal\user\UserInterface The owner user entity.

Overrides EntityOwnerInterface::getOwner

File

src/Entity/OgMembership.php, line 103

Class

OgMembership
The membership entity that connects a group and a user.

Namespace

Drupal\og\Entity

Code

public function getOwner() {
  assert(!empty($this
    ->get('uid')->entity), new \LogicException(__METHOD__ . '() should only be called on loaded memberships, or on newly created memberships that already have the owner set.'));
  return $this
    ->get('uid')->entity;
}