basic (array) cache implementation

copyright Copyright (c) 2012, Open Source Solutions Limited, Dublin, Ireland
author Barry O'Donovan

 Methods

Cache constructor.

__construct() : \OSS_SNMP\Cache\Basic

For basic cache, takes no parameters.

Returns

\OSS_SNMP\Cache\BasicAn instance of the cache ($this) for fluent interfaces

Clear a named value from the cache

clear(string $var) 

Parameters

$var

string

The name of the value to clear

Clear all values from the cache

clearAll() 

Load a named value from the cache (or null if not present)

load(string $var) : mixed | null

Parameters

$var

string

The name of the value to load

Returns

mixednullThe value from the cache or null

Save a named value to the cache

save(string $var, mixed $val) : mixed

Parameters

$var

string

The name of the value to save

$val

mixed

The value to save

Returns

mixedThe value (as passed)

 Properties

 

$_cache

$_cache