PHP Interface Pinq\Caching\ICacheAdapter

Author: Elliot Levin ([email protected])
Show file Open project: timetoogo/pinq Interface Usage Examples

Public Methods

Method Description
clear ( ) : void Clears all cached values under the namespace.
contains ( string $key ) : boolean Returns whether the supplied function has
forNamespace ( string $namespace ) : Pinq\Caching\ICacheAdapter Returns a new cache implementation for a new namespace.
getNamespace ( ) : string The namespace of the cache.
hasNamespace ( ) : boolean Whether the cache is namespaced.
inGlobalNamespace ( ) : Pinq\Caching\ICacheAdapter Returns a new cache implementation for the global namespace.
remove ( string $key ) : void Removes the value associated with the supplied key
save ( string $key, mixed $value ) : void Saves the supplied value to the cache.
tryGet ( string $key ) : mixed Attempt to get the cached value associated with the supplied key

Method Details

clear() public method

Clears all cached values under the namespace.
public clear ( ) : void
return void

contains() public method

Returns whether the supplied function has
public contains ( string $key ) : boolean
$key string
return boolean

forNamespace() public method

Returns a new cache implementation for a new namespace.
public forNamespace ( string $namespace ) : Pinq\Caching\ICacheAdapter
$namespace string
return Pinq\Caching\ICacheAdapter

getNamespace() public method

The namespace of the cache.
public getNamespace ( ) : string
return string

hasNamespace() public method

Whether the cache is namespaced.
public hasNamespace ( ) : boolean
return boolean

inGlobalNamespace() public method

Returns a new cache implementation for the global namespace.
public inGlobalNamespace ( ) : Pinq\Caching\ICacheAdapter
return Pinq\Caching\ICacheAdapter

remove() public method

Removes the value associated with the supplied key
public remove ( string $key ) : void
$key string
return void

save() public method

Saves the supplied value to the cache.
public save ( string $key, mixed $value ) : void
$key string
$value mixed
return void

tryGet() public method

Attempt to get the cached value associated with the supplied key
public tryGet ( string $key ) : mixed
$key string
return mixed