Class TSqlMapCache

Description

Implements interfaces:

Allow different implementation of caching strategy. See <tt>TSqlMapFifoCache</tt> for a first-in-first-out implementation. See <tt>TSqlMapLruCache</tt> for a least-recently-used cache implementation.

  • author: Wei Zhuo <weizhuo[at]gmail[dot]com>
  • version: $Id: TSqlMapCache.php 2996 2011-06-20 15:24:57Z ctrlaltca@gmail.com $
  • abstract:
  • since: 3.1

Located in /Data/SqlMap/DataMapper/TSqlMapCache.php (line 23)


	
			
Direct descendents
Class Description
TSqlMapFifoCache First-in-First-out cache implementation, removes object that was first added when the cache is full.
TSqlMapLruCache Least recently used cache implementation, removes object that was accessed last when the cache is full.
Variable Summary
mixed $_cache
mixed $_cacheModel
mixed $_cacheSize
mixed $_keyList
Method Summary
TSqlMapCache __construct ([ $cacheModel = null], TSqlMapCacheModel $cacheModel.)
void add ( $id,  $value, [ $expire = 0], [ $dependency = null])
object the delete ( $key)
void flush ()
int getCacheSize ()
void setCacheSize (int $value)
Variables
mixed $_cache (line 26)
  • access: protected
mixed $_cacheModel = null (line 28)
  • access: protected
mixed $_cacheSize = 100 (line 27)
  • access: protected
mixed $_keyList (line 25)
  • access: protected
Methods
Constructor __construct (line 34)

Create a new cache with limited cache size.

  • access: public
TSqlMapCache __construct ([ $cacheModel = null], TSqlMapCacheModel $cacheModel.)
add (line 81)
  • throws: TSqlMapException not implemented.
  • access: public
void add ( $id,  $value, [ $expire = 0], [ $dependency = null])
  • $id
  • $value
  • $expire
  • $dependency
delete (line 61)
  • return: object removed if exists, null otherwise.
  • access: public
object the delete ( $key)
  • $key
flush (line 72)

Clears the cache.

  • access: public
void flush ()
getCacheSize (line 53)
  • return: cache size.
  • access: public
int getCacheSize ()
setCacheSize (line 45)

Maximum number of items to cache. Default size is 100.

  • access: public
void setCacheSize (int $value)
  • int $value: cache size.

Documentation generated on Mon, 25 Jun 2012 14:39:15 +0200 by phpDocumentor 1.4.3