You are here

class PermanentDatabaseBackend in Permanent Cache Bin 8

Same name and namespace in other branches
  1. 8.2 src/Cache/PermanentDatabaseBackend.php \Drupal\pcb\Cache\PermanentDatabaseBackend

Defines a permanent database cache implementation.

This cache implementation can be used for data like stock which don't really need to be cleared during normal cache rebuilds and need to be cleared . It uses the database to store cached data. Each cache bin corresponds to a database table by the same name.

Hierarchy

Expanded class hierarchy of PermanentDatabaseBackend

File

src/Cache/PermanentDatabaseBackend.php, line 18

Namespace

Drupal\pcb\Cache
View source
class PermanentDatabaseBackend extends DatabaseBackend {

  /**
   * {@inheritdoc}
   */
  public function deleteAll() {

    // This cache doesn't need to be deleted when doing cache rebuild.
    // We do nothing here.
  }

  /**
   * Deletes all cache items in a bin when explicitly called.
   *
   * @see \Drupal\Core\Cache\DatabaseBackend::deleteAll()
   */
  public function deleteAllPermanent() {
    parent::deleteAll();
  }

}

Members

Namesort descending Modifiers Type Description Overrides
CacheBackendInterface::CACHE_PERMANENT constant Indicates that the item should never be removed unless explicitly deleted.
DatabaseBackend::$bin protected property
DatabaseBackend::$checksumProvider protected property The cache tags checksum provider.
DatabaseBackend::$connection protected property The database connection.
DatabaseBackend::$maxRows protected property The maximum number of rows that this cache bin table is allowed to store.
DatabaseBackend::catchException protected function Act on an exception when cache might be stale.
DatabaseBackend::DEFAULT_MAX_ROWS constant The default maximum number of rows that this cache bin table can store.
DatabaseBackend::delete public function Deletes an item from the cache. Overrides CacheBackendInterface::delete
DatabaseBackend::deleteMultiple public function Deletes multiple items from the cache. Overrides CacheBackendInterface::deleteMultiple
DatabaseBackend::doSetMultiple protected function Stores multiple items in the persistent cache.
DatabaseBackend::ensureBinExists protected function Check if the cache bin exists and create it if not.
DatabaseBackend::garbageCollection public function Performs garbage collection on a cache bin. Overrides CacheBackendInterface::garbageCollection
DatabaseBackend::get public function Returns data from the persistent cache. Overrides CacheBackendInterface::get
DatabaseBackend::getMaxRows public function The maximum number of rows that this cache bin table is allowed to store.
DatabaseBackend::getMultiple public function Returns data from the persistent cache when given an array of cache IDs. Overrides CacheBackendInterface::getMultiple
DatabaseBackend::invalidate public function Marks a cache item as invalid. Overrides CacheBackendInterface::invalidate
DatabaseBackend::invalidateAll public function Marks all cache items as invalid. Overrides CacheBackendInterface::invalidateAll
DatabaseBackend::invalidateMultiple public function Marks cache items as invalid. Overrides CacheBackendInterface::invalidateMultiple
DatabaseBackend::MAXIMUM_NONE constant -1 means infinite allows numbers of rows for the cache backend.
DatabaseBackend::normalizeCid protected function Normalizes a cache ID in order to comply with database limitations.
DatabaseBackend::prepareItem protected function Prepares a cached item.
DatabaseBackend::removeBin public function Remove a cache bin. Overrides CacheBackendInterface::removeBin
DatabaseBackend::schemaDefinition public function Defines the schema for the {cache_*} bin tables.
DatabaseBackend::set public function Stores data in the persistent cache. Overrides CacheBackendInterface::set
DatabaseBackend::setMultiple public function Store multiple items in the persistent cache. Overrides CacheBackendInterface::setMultiple
DatabaseBackend::__construct public function Constructs a DatabaseBackend object.
PermanentDatabaseBackend::deleteAll public function Deletes all cache items in a bin. Overrides DatabaseBackend::deleteAll
PermanentDatabaseBackend::deleteAllPermanent public function Deletes all cache items in a bin when explicitly called.