interface CacheInterface

Cache interface

Methods

mixed|false
fetch(string $id)

Fetch entry.

bool
save(string $id, mixed $data, int $lifeTime = 0)

Save data into the cache.

bool
has(string $id)

Check if cache contains item

bool
delete(string $id)

Delete cache entry.

array|null
getStats()

Return cache stats

bool
clear()

Delete all cache items.

Details

at line 23
mixed|false fetch(string $id)

Fetch entry.

Parameters

string $id

Return Value

mixed|false The cached data or false

at line 33
bool save(string $id, mixed $data, int $lifeTime = 0)

Save data into the cache.

Parameters

string $id The cache id.
mixed $data The cache entry/data.
int $lifeTime In minutes

Return Value

bool true if data was successfully stored in the cache, false otherwise.

at line 41
bool has(string $id)

Check if cache contains item

Parameters

string $id

Return Value

bool

at line 49
bool delete(string $id)

Delete cache entry.

Parameters

string $id cache id.

Return Value

bool

at line 56
array|null getStats()

Return cache stats

Return Value

array|null

at line 63
bool clear()

Delete all cache items.

Return Value

bool