function BatchUserAction::executeMultiple
Same name in other branches
- 9 core/modules/views/tests/modules/user_batch_action_test/src/Plugin/Action/BatchUserAction.php \Drupal\user_batch_action_test\Plugin\Action\BatchUserAction::executeMultiple()
- 8.9.x core/modules/views/tests/modules/user_batch_action_test/src/Plugin/Action/BatchUserAction.php \Drupal\user_batch_action_test\Plugin\Action\BatchUserAction::executeMultiple()
- 10 core/modules/views/tests/modules/user_batch_action_test/src/Plugin/Action/BatchUserAction.php \Drupal\user_batch_action_test\Plugin\Action\BatchUserAction::executeMultiple()
Overrides ActionBase::executeMultiple
1 call to BatchUserAction::executeMultiple()
- BatchUserAction::execute in core/
modules/ views/ tests/ modules/ user_batch_action_test/ src/ Plugin/ Action/ BatchUserAction.php - Executes the plugin.
File
-
core/
modules/ views/ tests/ modules/ user_batch_action_test/ src/ Plugin/ Action/ BatchUserAction.php, line 26
Class
- BatchUserAction
- Provides action that sets batch precessing.
Namespace
Drupal\user_batch_action_test\Plugin\ActionCode
public function executeMultiple(array $entities) {
$operations = [];
foreach ($entities as $entity) {
$operations[] = [
[
static::class,
'processBatch',
],
[
[
'entity_type' => $entity->getEntityTypeId(),
'entity_id' => $entity->id(),
],
],
];
}
if ($operations) {
$batch = [
'operations' => $operations,
'finished' => [
static::class,
'finishBatch',
],
];
batch_set($batch);
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.