class Cache (View source)

Cache values

Methods

static void
set(string $cacheKey, mixed $value)

Store a value

static bool
has(string $cacheKey)

Does the cache have a value stored for the key

static mixed
get(string $cacheKey, mixed $defaultValue = null)

Get back a cached value

static void
remove(string $cacheKey)

Remove a cached value

static void
purge()

Purge all cached values

Details

static void set(string $cacheKey, mixed $value)

Store a value

Parameters

string $cacheKey

The key to use

mixed $value

The value to cache

Return Value

void

static bool has(string $cacheKey)

Does the cache have a value stored for the key

Parameters

string $cacheKey

The key to use

Return Value

bool

static mixed get(string $cacheKey, mixed $defaultValue = null)

Get back a cached value

Parameters

string $cacheKey

The key to use

mixed $defaultValue

The default value in case it does not exist

Return Value

mixed

The cached value

static void remove(string $cacheKey)

Remove a cached value

Parameters

string $cacheKey

The key to use to remove the value

Return Value

void

static void purge()

Purge all cached values

Return Value

void