You are here

private static function CleanerWatchdogController::cleanWatchdog in Cleaner 8

Perform clearing database table - "watchdog".

Return value

bool TRUE on success, FALSE otherwise.

1 call to CleanerWatchdogController::cleanWatchdog()
CleanerWatchdogController::execute in src/Controller/CleanerWatchdogController.php
Perform the operation.

File

src/Controller/CleanerWatchdogController.php, line 56

Class

CleanerWatchdogController
Class CleanerWatchdogController.

Namespace

Drupal\cleaner\Controller

Code

private static function cleanWatchdog() {
  if (!\Drupal::database()
    ->schema()
    ->tableExists('watchdog')) {
    return FALSE;
  }
  return (bool) \Drupal::database()
    ->query('TRUNCATE {watchdog}')
    ->execute();
}