You are here

protected function ImportCommand::deleteContent in Tome 8

Deletes content using sub-processes.

Parameters

array $names: An array of content names.

int $entity_count: The number of entities to import per process.

int $process_count: The number of processes to invoke concurrently.

Return value

bool Whether or not the import completed successful.

2 calls to ImportCommand::deleteContent()
ImportCommand::execute in modules/tome_sync/src/Commands/ImportCommand.php
ImportPartialCommand::execute in modules/tome_sync/src/Commands/ImportPartialCommand.php

File

modules/tome_sync/src/Commands/ImportCommand.php, line 197

Class

ImportCommand
Contains the tome:import command.

Namespace

Drupal\tome_sync\Commands

Code

protected function deleteContent(array $names, $entity_count, $process_count) {
  $commands = [];
  foreach (array_chunk($names, $entity_count) as $names) {
    $commands[] = $this->executable . ' tome:delete-content ' . escapeshellarg(implode(',', $names));
  }
  $collected_errors = $this
    ->runCommands($commands, $process_count, 0);
  if (!empty($collected_errors)) {
    $this
      ->io()
      ->error('Errors encountered when deleting content:');
    $this
      ->displayErrors($collected_errors);
    return FALSE;
  }
  return TRUE;
}