PHP Class Prado\Data\SqlMap\Configuration\TSqlMapCacheModel

The results from a query Mapped Statement can be cached simply by specifying the {@link CacheModel TSqlMapStatement::setCacheModel()} property in tag. A cache model is a configured cache that is defined within the sql map configuration file. Cache models are configured using the element. The cache model uses a pluggable framework for supporting different types of caches. The choice of cache is specified by the {@link Implementation setImplementation()} property. The class name specified must be one of {@link TSqlMapCacheTypes}. The cache implementations, LRU and FIFO cache below do not persist across requests. That is, once the request is complete, all cache data is lost. These caches are useful queries that results in the same repeated data during the current request.
Since: 3.1
Inheritance: extends Prado\TComponent
Mostra file Open project: pradosoft/prado Class Usage Examples

Public Methods

Method Description
flush ( ) Clears the cache.
get ( $key ) : mixed
getFlushInterval ( ) : integer
getHitRatio ( ) : float
getID ( ) : string
getImplementation ( ) : string
getImplementationClass ( ) : string
initialize ( $cache = null ) Initialize the cache implementation, sets the actual cache contain if supplied.
registerCacheType ( $type, $className )
registerTriggerStatement ( $mappedStatement ) Register a mapped statement that will trigger a cache flush.
set ( $key, $value )
setFlushInterval ( $value )
setID ( $value )
setImplementation ( $value )

Method Details

flush() public method

Clears the cache.
public flush ( )

get() public method

public get ( $key ) : mixed
return mixed cached value.

getFlushInterval() public method

public getFlushInterval ( ) : integer
return integer cache duration.

getHitRatio() public method

public getHitRatio ( ) : float
return float cache hit ratio.

getID() public method

public getID ( ) : string
return string unique cache model identifier.

getImplementation() public method

public getImplementation ( ) : string
return string cache implements of TSqlMapCacheTypes, either 'Basic', 'LRU' or 'FIFO'.

getImplementationClass() public method

public getImplementationClass ( ) : string
return string cache implementation class name.

initialize() public method

Initialize the cache implementation, sets the actual cache contain if supplied.
public initialize ( $cache = null )

registerCacheType() public static method

public static registerCacheType ( $type, $className )

registerTriggerStatement() public method

Register a mapped statement that will trigger a cache flush.
public registerTriggerStatement ( $mappedStatement )

set() public method

public set ( $key, $value )

setFlushInterval() public method

public setFlushInterval ( $value )

setID() public method

public setID ( $value )

setImplementation() public method

public setImplementation ( $value )