\duncan3dc\HelpersCache

Summary

Methods
Properties
Constants
getInstance()
check()
get()
set()
clear()
call()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$instances
$data
N/A

Properties

$instances

$instances : array<mixed,\duncan3dc\Helpers\CacheInstance>

Type

array<mixed,\duncan3dc\Helpers\CacheInstance> — Internal management of the instantiated cache instances

$data

$data : array

Type

array — Internal storage of cached data

Methods

getInstance()

getInstance(string $name) : \duncan3dc\Helpers\CacheInstance

Get a named instance of CacheInstance for segregating cache data.

Parameters

string $name

The name of the instance to get

Returns

\duncan3dc\Helpers\CacheInstance

check()

check(string $key) : boolean

Check if the specified key has already been cached.

Parameters

string $key

The key of the cached data

Returns

boolean

get()

get(string $key) : mixed

Get the stored value of the specified key.

Parameters

string $key

The key of the cached data

Returns

mixed

set()

set(string $key, string $value) : void

Set the specified key to the specified value.

Parameters

string $key

The key of the cached data

string $value

The value to storage against the key

clear()

clear(string $key) : void

Clear a key within the cache data, or call without an argument to clear all the cached data.

Parameters

string $key

The key of the cached data

call()

call(string $key, callable $func) : mixed

Convience method to retrieve a value if it's cached, or run the callback and cache the data now if not.

Parameters

string $key

The key of the cached data

callable $func

A function to call that will return the value to cache

Returns

mixed