class CacheStub in Drupal driver for SQL Server and SQL Azure 8.2
Stub implementation for the cache backend.
Hierarchy
- class \Drupal\Driver\Database\sqlsrv\Component\CacheStub implements CacheInterface
Expanded class hierarchy of CacheStub
File
- drivers/
lib/ Drupal/ Driver/ Database/ sqlsrv/ Component/ CacheStub.php, line 8
Namespace
Drupal\Driver\Database\sqlsrv\ComponentView source
class CacheStub implements CacheInterface {
private $prefix = null;
/**
* This cache stores everything in-memory during the
* lifetime of this request.
*
* @var array
*/
private $data = [];
public function __construct($prefix) {
$this->prefix = $prefix;
}
/**
* {@inheritdoc}
*/
public function Set($cid, $data) {
$cache = new \stdClass();
$cache->data = $data;
$cache->serialized = false;
$cache->timestamp = time();
$this->data[$cid] = clone $cache;
}
/**
* {@inheritdoc}
*/
public function Get($cid) {
if (isset($this->data[$cid])) {
return $this->data[$cid];
}
return false;
}
/**
* {@inheritdoc}
*/
public function Clear($cid) {
unset($this->data[$cid]);
}
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CacheStub:: |
private | property | This cache stores everything in-memory during the lifetime of this request. | |
CacheStub:: |
private | property | ||
CacheStub:: |
public | function |
Clear a cache item. Overrides CacheInterface:: |
|
CacheStub:: |
public | function |
Get a cache item. Overrides CacheInterface:: |
|
CacheStub:: |
public | function |
Set a cache item. Overrides CacheInterface:: |
|
CacheStub:: |
public | function |