\duncan3dc\HelpersCacheInstance

Summary

Methods
Properties
Constants
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
$data
N/A

Properties

$data

$data : array

Type

array — Internal storage of cached data

Methods

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, mixed $value) : void

Set the specified key to the specified value.

Parameters

string $key

The key of the cached data

mixed $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.

The key parameter is optional, just a callback can be passed. If so the calling class/method will be used as the cache key.

Parameters

string $key

The key of the cached data

callable $func

A function to call that will return the value to cache

Returns

mixed