Class Cache
Wrapper for caching data.
Methods summary
private
|
#
__construct( string $adapter )
Cache constructor.
Parameters
Throws
DomainException Not supported Cache adapter.
InvalidArgumentException Not compatible Cache adapter type.
|
public
|
#
__clone( )
Cloning of Cache is disallowed.
Cloning of Cache is disallowed.
|
final public static
Core\Modules\Cache\Cache
|
#
getInstance( string $adapter )
Returns an instance of the Cache object.
Returns an instance of the Cache object.
Parameters
Returns
Uses
|
public
boolean
|
#
store( string $key, mixed $value, integer $expire = 0 )
Stores value by key.
Parameters
- $key
- Cache key.
- $value
- Cache value.
- $expire
- Expire time, in seconds(optional).
Returns
boolean
|
public
mixed
|
#
fetch( string $key )
Fetches stored value by key.
Fetches stored value by key.
Parameters
Returns
mixed
|
public
boolean
|
#
exists( string $key )
Checks if a key-value pair exists.
Checks if a key-value pair exists.
Parameters
Returns
boolean
|
public
boolean
|
#
remove( string $key )
Removes a key-value pair.
Removes a key-value pair.
Parameters
Returns
boolean
|
Properties summary
private static
Core\Modules\Cache\Cache
|
$instance
Reference to the current instance of the Cache object.
Reference to the current instance of the Cache object.
|
|
private
mixed
|
$adapter
Reference to the current adapter of the Cache object.
Reference to the current adapter of the Cache object.
|
|