You are here

protected function BulkEdit::persistBulkEditEntityIds in Views Bulk Edit 8

Saves the entity Ids.

Parameters

\Drupal\Core\Entity\EntityInterface[] $entities_keyed: An array of entities.

1 call to BulkEdit::persistBulkEditEntityIds()
BulkEdit::executeMultiple in src/Plugin/Action/BulkEdit.php
Executes the plugin for an array of objects.

File

src/Plugin/Action/BulkEdit.php, line 97

Class

BulkEdit
Bulk edit entities.

Namespace

Drupal\views_bulk_edit\Plugin\Action

Code

protected function persistBulkEditEntityIds(array $entities_keyed) {
  $privateStore = $this->privateTempStoreFactory
    ->get('views_bulk_edit');
  $entity_data = [];
  foreach ($entities_keyed as $entity_id => $entity) {
    $entity_data[$entity
      ->getEntityTypeId()][$entity
      ->bundle()][] = $entity
      ->id();
  }
  $privateStore
    ->set('entity_data', $entity_data);
}