You are here

public function MembershipManagerInterface::createMembership in Organic groups 8

Creates an OG membership.

Parameters

\Drupal\Core\Entity\EntityInterface $group: The group entity.

\Drupal\user\UserInterface $user: The user object.

string $membership_type: (optional) The membership type. Defaults to \Drupal\og\OgMembershipInterface::TYPE_DEFAULT.

Return value

\Drupal\og\OgMembershipInterface The unsaved membership object.

1 method overrides MembershipManagerInterface::createMembership()
MembershipManager::createMembership in src/MembershipManager.php
Creates an OG membership.

File

src/MembershipManagerInterface.php, line 183

Class

MembershipManagerInterface
Membership manager interface.

Namespace

Drupal\og

Code

public function createMembership(EntityInterface $group, UserInterface $user, $membership_type = OgMembershipInterface::TYPE_DEFAULT);