You are here

public function ChangeMultipleOgMembershipRolesBase::executeMultiple in Organic groups 8

Executes the plugin for an array of objects.

Parameters

array $objects: An array of entities.

Overrides ActionBase::executeMultiple

1 call to ChangeMultipleOgMembershipRolesBase::executeMultiple()
ChangeMultipleOgMembershipRolesBase::execute in src/Plugin/Action/ChangeMultipleOgMembershipRolesBase.php
Executes the plugin.

File

src/Plugin/Action/ChangeMultipleOgMembershipRolesBase.php, line 70

Class

ChangeMultipleOgMembershipRolesBase
Provides a base class for actions that change multiple roles at once.

Namespace

Drupal\og\Plugin\Action

Code

public function executeMultiple(array $memberships) {

  // Store the memberships to be processed in temporary storage. The actual
  // processing will be handled in the confirmation form.
  // @see \Drupal\og\Form\OgAddMultipleRolesForm
  // @see \Drupal\og\Form\OgRemoveMultipleRolesForm
  $membership_ids = array_map(function (OgMembershipInterface $membership) {
    return $membership
      ->id();
  }, $memberships);
  $this->tempStore
    ->set('membership_ids', $membership_ids);
}