You are here

public function FileDelete::executeMultiple in File Entity (fieldable files) 8.2

Executes the plugin for an array of objects.

Parameters

array $objects: An array of entities.

Overrides ActionBase::executeMultiple

1 call to FileDelete::executeMultiple()
FileDelete::execute in src/Plugin/Action/FileDelete.php
Executes the plugin.

File

src/Plugin/Action/FileDelete.php, line 57

Class

FileDelete
Delete a file.

Namespace

Drupal\file_entity\Plugin\Action

Code

public function executeMultiple(array $entities) {

  // @todo Make translation-aware, similar to node.
  $entities_by_id = [];
  foreach ($entities as $entity) {
    $entities_by_id[$entity
      ->id()] = $entity;
  }

  // Just save in temp store for now, delete after confirmation.
  $this->tempStore
    ->set('delete', $entities_by_id);
}