public function DeleteFilesActionForce::executeMultiple in Fancy File Delete 2.0.x
Executes the plugin for an array of objects.
Parameters
array $objects: An array of entities.
Overrides DeleteFilesAction::executeMultiple
1 call to DeleteFilesActionForce::executeMultiple()
- DeleteFilesActionForce::execute in src/
Plugin/ Action/ DeleteFilesActionForce.php - Executes the plugin.
File
- src/
Plugin/ Action/ DeleteFilesActionForce.php, line 23
Class
- DeleteFilesActionForce
- Force Deletes Files.
Namespace
Drupal\fancy_file_delete\Plugin\ActionCode
public function executeMultiple(array $entities) {
// Set entities to batch our way.
$values = [];
foreach ($entities as $entity) {
if ($entity instanceof UnmanagedFiles) {
$values[] = $entity
->getPath();
}
elseif ($entity instanceof File) {
$values[] = $entity
->id();
}
}
// Send to batch.
$this->batch
->setBatch($values, TRUE);
}