You are here

public function LinkCleanUp::removeAllBatch in Link checker 8

Removes all extracted links.

File

src/LinkCleanUp.php, line 54

Class

LinkCleanUp
Class LinkCleanUp.

Namespace

Drupal\linkchecker

Code

public function removeAllBatch() {

  // Clear index to reindex all entities.
  $this->database
    ->truncate('linkchecker_index');
  $batch = new BatchBuilder();
  $batch
    ->setTitle('Remove links')
    ->addOperation([
    $this,
    'batchProcessDelete',
  ])
    ->setProgressive()
    ->setFinishCallback([
    $this,
    'batchFinished',
  ]);
  batch_set($batch
    ->toArray());
}