$ttl
$ttl : integer
Global time-to-live
Database cache adapter class
$db : \Pop\Db\Adapter\AbstractAdapter
Database adapter
__construct(\Pop\Db\Adapter\AbstractAdapter $db, integer $ttl, string $table = 'pop_cache')
Constructor
Instantiate the DB writer object
The DB table requires the following fields at a minimum:
id INT
key VARCHAR
start INT
ttl INT
value TEXT, VARCHAR, etc.
\Pop\Db\Adapter\AbstractAdapter | $db | |
integer | $ttl | |
string | $table |
setTtl(integer $ttl) : \Pop\Cache\Adapter\AbstractAdapter
Set the global time-to-live for the cache adapter
integer | $ttl |
saveItem(string $id, mixed $value, integer $ttl = null) : \Pop\Cache\Adapter\Db
Save an item to cache
string | $id | |
mixed | $value | |
integer | $ttl |
deleteItem(string $id) : \Pop\Cache\Adapter\Db
Delete a value in cache
string | $id |
clear() : \Pop\Cache\Adapter\Db
Clear all stored values from cache
destroy() : \Pop\Cache\Adapter\Db
Destroy cache resource
setDb(string $db) : \Pop\Cache\Adapter\Db
Set the current cache db adapter.
string | $db |
getDb() : \Pop\Db\Adapter\AbstractAdapter
Get the current cache db adapter.
setTable(string $table) : \Pop\Cache\Adapter\Db
Set the cache db table
string | $table |