function DrupalDatabaseCache::isEmpty

DrupalDatabaseCache::isEmpty()

Implements DrupalCacheInterface::isEmpty().

Overrides DrupalCacheInterface::isEmpty

File

includes/cache.inc, line 550
Functions and interfaces for cache handling.

Class

DrupalDatabaseCache
Defines a default cache implementation.

Code

function isEmpty() {
  $this->garbageCollection();
  $query = db_select($this->bin);
  $query->addExpression('1');
  $result = $query->range(0, 1)
    ->execute()
    ->fetchField();
  return empty($result);
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/includes!cache.inc/function/DrupalDatabaseCache::isEmpty/7.x