You are here

public function OgMembership::getGroupEntityType in Organic groups 8

Gets the group entity type.

Return value

string The entity type.

Overrides OgMembershipInterface::getGroupEntityType

2 calls to OgMembership::getGroupEntityType()
OgMembership::getGroup in src/Entity/OgMembership.php
Gets the group associated with the membership.
OgMembership::getRoles in src/Entity/OgMembership.php
Gets all the referenced OG roles.

File

src/Entity/OgMembership.php, line 146

Class

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

Namespace

Drupal\og\Entity

Code

public function getGroupEntityType() : string {
  $entity_type = $this
    ->getFieldValue('entity_type', 'value') ?: '';
  assert(!empty($entity_type), new \LogicException(__METHOD__ . '() should only be called on loaded memberships, or on newly created memberships that already have the group type set.'));
  return $entity_type;
}