public function SocialEventManagersSendEmail::executeMultiple in Open Social 10.0.x
Same name and namespace in other branches
- 8.9 modules/social_features/social_event/modules/social_event_managers/src/Plugin/Action/SocialEventManagersSendEmail.php \Drupal\social_event_managers\Plugin\Action\SocialEventManagersSendEmail::executeMultiple()
- 8.8 modules/social_features/social_event/modules/social_event_managers/src/Plugin/Action/SocialEventManagersSendEmail.php \Drupal\social_event_managers\Plugin\Action\SocialEventManagersSendEmail::executeMultiple()
- 10.3.x modules/social_features/social_event/modules/social_event_managers/src/Plugin/Action/SocialEventManagersSendEmail.php \Drupal\social_event_managers\Plugin\Action\SocialEventManagersSendEmail::executeMultiple()
- 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()
- 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\ActionCode
public function executeMultiple(array $objects) {
$users = [];
$chunks = array_chunk($objects, 15);
// Process the event enrollment chunks. These need to be converted to users.
foreach ($chunks as $chunk) {
$entities = [];
/** @var \Drupal\social_event\Entity\EventEnrollment $enrollment */
foreach ($chunk as $enrollment) {
// 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);
}
return parent::executeMultiple($users);
}