TCache is the base class for cache classes with different cache storage implementation.
TCache implements the interface {@link ICache} with the following methods,
- {@link get} : retrieve the value with a key (if any) from cache
- {@link set} : store the value with a key into cache
- {@link add} : store the value only if cache does not have this key
- {@link delete} : delete the value with the specified key from cache
- {@link flush} : delete all values from cache
Each value is associated with an expiration time. The {@link get} operation
ensures that any expired value will not be returned. The expiration time by
the number of seconds. A expiration time 0 represents never expire.
By definition, cache does not ensure the existence of a value
even if it never expires. Cache is not meant to be an persistent storage.
Child classes must implement the following methods:
- {@link getValue}
- {@link setValue}
- {@link addValue}
- {@link deleteValue}
and optionally {@link flush}
Since version 3.1.2, TCache implements the \ArrayAccess interface such that
the cache acts as an array.