public function BulkCloneNode::executeMultiple in Entity Bulk Clone 8
Executes the plugin for an array of objects.
Parameters
array $objects: An array of entities.
Overrides ActionBase::executeMultiple
File
- src/
Plugin/ Action/ BulkCloneNode.php, line 23
Class
- BulkCloneNode
- Entity Bulk clone of nodes.
Namespace
Drupal\entity_bulk_clone\Plugin\ActionCode
public function executeMultiple(array $objects) {
$results = [];
foreach ($objects as $entity) {
$results[] = $this
->execute($entity);
}
if (isset($results) && !empty($results)) {
$batch = [
'title' => $this
->t('Content Bulk Cloning...'),
'operations' => $results,
'finished' => '\\Drupal\\entity_bulk_clone\\Plugin\\BulkCloneNode::batchFinished',
];
batch_set($batch);
}
}