You are here

protected function OgChangeMultipleRolesFormBase::getMemberships in Organic groups 8

Returns an array of memberships on which to change roles.

Return value

\Drupal\og\OgMembershipInterface[] The array of memberships.

6 calls to OgChangeMultipleRolesFormBase::getMemberships()
OgAddMultipleRolesForm::submitForm in src/Form/OgAddMultipleRolesForm.php
Form submission handler.
OgChangeMultipleRolesFormBase::access in src/Form/OgChangeMultipleRolesFormBase.php
Controls access to the form.
OgChangeMultipleRolesFormBase::getGroupTypes in src/Form/OgChangeMultipleRolesFormBase.php
Returns an array of group types for which memberships are present.
OgChangeMultipleRolesFormBase::submitForm in src/Form/OgChangeMultipleRolesFormBase.php
Form submission handler.
OgRemoveMultipleRolesForm::buildForm in src/Form/OgRemoveMultipleRolesForm.php
Form constructor.

... See full list

File

src/Form/OgChangeMultipleRolesFormBase.php, line 165

Class

OgChangeMultipleRolesFormBase
Base class for forms that act on multiple roles.

Namespace

Drupal\og\Form

Code

protected function getMemberships() {
  if (empty($this->memberships)) {
    $membership_ids = $this
      ->getTempStore()
      ->get('membership_ids');
    if (!empty($membership_ids)) {
      $this->memberships = OgMembership::loadMultiple($membership_ids);
    }
  }
  return $this->memberships;
}