Skip to content
Snippets Groups Projects

Issue #3329824: Define a PermanentBackendInterface

6 files
+ 67
90
Compare changes
  • Side-by-side
  • Inline
Files
6
@@ -3,35 +3,16 @@
namespace Drupal\pcb_memcache\Cache;
use Drupal\memcache\MemcacheBackend;
use Drupal\pcb\Cache\PermanentBackendInterface;
use Drupal\pcb\Cache\PermanentBackendTrait;
/**
* Defines a permanent memcache 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.
*
* @ingroup cache
* {@inheritdoc}
*/
class PermanentMemcacheBackend extends MemcacheBackend {
/**
* {@inheritdoc}
*/
public function deleteAll() {
// This cache doesn't need to be deleted when doing cache rebuild.
// We do nothing here.
}
class PermanentMemcacheBackend extends MemcacheBackend implements PermanentBackendInterface {
/**
* Deletes all cache items in a bin when explicitly called.
*
* @see \Drupal\Core\Cache\DatabaseBackend::deleteAll()
*/
public function deleteAllPermanent() {
parent::deleteAll();
}
use PermanentBackendTrait;
}
Loading