DeleteFilesActionForce.php in Fancy File Delete 2.0.x
File
src/Plugin/Action/DeleteFilesActionForce.php
View source
<?php
namespace Drupal\fancy_file_delete\Plugin\Action;
use Drupal\fancy_file_delete\Entity\UnmanagedFiles;
use Drupal\file\Entity\File;
class DeleteFilesActionForce extends DeleteFilesAction {
public function executeMultiple(array $entities) {
$values = [];
foreach ($entities as $entity) {
if ($entity instanceof UnmanagedFiles) {
$values[] = $entity
->getPath();
}
elseif ($entity instanceof File) {
$values[] = $entity
->id();
}
}
$this->batch
->setBatch($values, TRUE);
}
public function execute($entity = NULL) {
$this
->executeMultiple([
$entity,
]);
}
}