PHP Class Cachearium\CacheKey

Show file Open project: corollarium/cachearium Class Usage Examples

Public Properties

Property Type Description
$base string This is the base key. It's the main index, so to speak. This is useful as a first level to separate cache data logically.
$id string This is the second key, usually an id.
$sub string

Public Methods

Method Description
__construct ( string $base, string $id, string $sub = '' )
debug ( ) : string Prints as a pretty string for debugging
getBase ( )
getHash ( ) : string Returns a hash for key.
getId ( )
getSub ( )
setBase ( $base )
setId ( $id )
setSub ( $sub )

Method Details

__construct() public method

public __construct ( string $base, string $id, string $sub = '' )
$base string Base string name for the type of cache (e.g., Event)
$id string Item id
$sub string If an item is cache in parts, this is used to specify the parts.

debug() public method

Prints as a pretty string for debugging
public debug ( ) : string
return string

getBase() public method

public getBase ( )

getHash() public method

Returns a hash for key.
public getHash ( ) : string
return string

getId() public method

public getId ( )

getSub() public method

public getSub ( )

setBase() public method

public setBase ( $base )

setId() public method

public setId ( $id )

setSub() public method

public setSub ( $sub )

Property Details

$base public property

This is the base key. It's the main index, so to speak. This is useful as a first level to separate cache data logically.
public string $base
return string

$id public property

This is the second key, usually an id.
public string $id
return string

$sub public property

public string $sub
return string