You are here

public function LinkCheckerCommands::clear in Link checker 8

Clears all link data and analyze content for links.

WARNING: Custom link check settings are deleted.

@command linkchecker:clear

@aliases lccl

File

src/Commands/LinkCheckerCommands.php, line 102

Class

LinkCheckerCommands
Drush 9 commands for Linkchecker module.

Namespace

Drupal\linkchecker\Commands

Code

public function clear() {
  $this
    ->analyzeCheckParams();
  $total = $this->extractorBatch
    ->getTotalEntitiesToProcess();
  if (!empty($total)) {
    $this->linkCleanUp
      ->removeAllBatch();
    $this->extractorBatch
      ->batch();
    drush_backend_batch_process();
  }
  else {
    $this
      ->logger()
      ->warning('No content configured for link analysis.');
  }
}