You are here

public function SocialEventManagersSendEmail::executeMultiple in Open Social 10.3.x

Same name and namespace in other branches
  1. 8.9 modules/social_features/social_event/modules/social_event_managers/src/Plugin/Action/SocialEventManagersSendEmail.php \Drupal\social_event_managers\Plugin\Action\SocialEventManagersSendEmail::executeMultiple()
  2. 8.8 modules/social_features/social_event/modules/social_event_managers/src/Plugin/Action/SocialEventManagersSendEmail.php \Drupal\social_event_managers\Plugin\Action\SocialEventManagersSendEmail::executeMultiple()
  3. 10.0.x modules/social_features/social_event/modules/social_event_managers/src/Plugin/Action/SocialEventManagersSendEmail.php \Drupal\social_event_managers\Plugin\Action\SocialEventManagersSendEmail::executeMultiple()
  4. 10.1.x modules/social_features/social_event/modules/social_event_managers/src/Plugin/Action/SocialEventManagersSendEmail.php \Drupal\social_event_managers\Plugin\Action\SocialEventManagersSendEmail::executeMultiple()
  5. 10.2.x modules/social_features/social_event/modules/social_event_managers/src/Plugin/Action/SocialEventManagersSendEmail.php \Drupal\social_event_managers\Plugin\Action\SocialEventManagersSendEmail::executeMultiple()

Executes the plugin for an array of objects.

Parameters

array $objects: An array of entities.

Overrides SocialSendEmail::executeMultiple

1 call to SocialEventManagersSendEmail::executeMultiple()
SocialEventAnEnrollSendEmail::executeMultiple in modules/social_features/social_event/modules/social_event_an_enroll/src/Plugin/Action/SocialEventAnEnrollSendEmail.php
Execute action on multiple entities.
1 method overrides SocialEventManagersSendEmail::executeMultiple()
SocialEventAnEnrollSendEmail::executeMultiple in modules/social_features/social_event/modules/social_event_an_enroll/src/Plugin/Action/SocialEventAnEnrollSendEmail.php
Execute action on multiple entities.

File

modules/social_features/social_event/modules/social_event_managers/src/Plugin/Action/SocialEventManagersSendEmail.php, line 75

Class

SocialEventManagersSendEmail
Send email to event enrollment users.

Namespace

Drupal\social_event_managers\Plugin\Action

Code

public function executeMultiple(array $objects) {
  $users = [];

  // Process the event enrollment chunks. These need to be converted to users.

  /** @var \Drupal\social_event\Entity\EventEnrollment $enrollment */
  foreach ($objects as $enrollment) {
    $entities = [];

    // Get the user from the even enrollment.

    /** @var \Drupal\user\Entity\User $user */
    $user = User::load($enrollment
      ->getAccount());
    $entities[] = $this
      ->execute($user);
    $users += $this->entityTypeManager
      ->getStorage('user')
      ->loadMultiple($entities);
  }

  // Pass it back to our parent who handles creation of queue items.
  return parent::executeMultiple($users);
}