Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. DatabaseBackend.php

function DatabaseBackend::deleteAll

Overrides CacheBackendInterface::deleteAll

File

core/lib/Drupal/Core/Cache/DatabaseBackend.php, line 333

Class

DatabaseBackend
Defines a default cache implementation.

Namespace

Drupal\Core\Cache

Code

public function deleteAll() {
    try {
        $this->connection
            ->truncate($this->bin)
            ->execute();
    } catch (\Exception $e) {
        // Create the cache table, which will be empty. This fixes cases during
        // core install where a cache table is cleared before it is set
        // with {cache_render} and {cache_data}.
        if (!$this->ensureBinExists()) {
            $this->catchException($e);
        }
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal