You are here

public static function DeleteEntity::deleteEntity in Entity Delete 8

Function to delete all the entities.

Parameters

int $delete_ids: Entity ids to be deleted.

int $count: Current row in the batch process.

int $total_count: Total count of ids in batch process.

string $entity: Entity selected.

string $bundle: Bundle selected.

string $context: Context.

File

src/DeleteEntity.php, line 26

Class

DeleteEntity
Service for Deleting the entity.

Namespace

Drupal\entity_delete

Code

public static function deleteEntity($delete_ids, $count, $total_count, $entity, $bundle, &$context) {
  $context['message'] = t("Now processing :current_row of :highest_row", [
    ':current_row' => $count,
    ":highest_row" => $total_count,
  ]);
  entity_delete_multiple($entity, $delete_ids);
  $context['results']['entity'] = $entity;
  $context['results']['bundle'] = $bundle;
  $context['results']['count'] = $total_count;
}