basic (array) cache implementation

See the implementation in \OSS_SNMP\Cache\Basic for proper examples and documentation.
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)

clear()

clear($varName) 

Parameters

$varName

clearAll()

clearAll() 

load()

load($varName) 

Parameters

$varName

save()

save($varName, $varValue) 

Parameters

$varName

$varValue

 Properties

 

An array to store results - a temporary cache

$_cache : array

Default