\APICacheModel

Database Storage engine for cache

Summary

Methods
Properties
Constants
init()
gc()
write()
read()
delete()
clear()
settings()
$settings
$model
$fields
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$settings

$settings : mixed||string|int

settings className = name of the model to use, default => Cache fields = database fields that hold data and ttl, default => data, expires

Type

mixed||string|int —

$model

$model : 

Model instance.

Type

$fields

$fields : 

Model instance.

Type

Methods

init()

init(mixed||string|int  settings = array()) : 

Initialize the Cache Engine

Called automatically by the cache frontend To reinitialize the settings call Cache::engine('EngineName', [optional] settings = array());

Parameters

mixed||string|int settings

array of setting for the engine

Returns

True if the engine has been successfully initialized, false if not

gc()

gc() : 

Garbage collection. Permanently remove all expired and deleted data

Permanently remove all expired and deleted data

Returns

write()

write(  key,   value,   duration = null) : 

Write data for key into cache

Parameters

key

Identifier for the data

value

Data to be cached

duration

How long to cache the data, in seconds

Returns

True if the data was successfully cached, false on failure

read()

read(  key) : 

Read a key from the cache

Parameters

key

Identifier for the data

Returns

The cached data, or false if the data doesn't exist, has expired, or if there was an error fetching it

delete()

delete(  key) : 

Delete a key from the cache

Parameters

key

Identifier for the data

Returns

True if the value was successfully deleted, false if it didn't exist or couldn't be removed

clear()

clear(  check = null) : 

Delete all keys from the cache

Parameters

check

if true will check expiration, otherwise delete all

Returns

True if the cache was successfully cleared, false otherwise

settings()

settings() : mixed||string|int

Cache Engine settings

Returns

mixed||string|int —

settings