## Class TSqlMapCache

Description

Implements interfaces:

- ICache

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.

- abstract:
- since: 3.1
- version: $Id: TSqlMapCache.php 2757 2010-01-15 14:47:40Z Christophe.Boulain $
- author: Wei Zhuo <weizhuo[at]gmail[dot]com>

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 ([mixed $cacheModel = null], TSqlMapCacheModel $cacheModel.)
void add (mixed $id, mixed $value, mixed $expire, [mixed $dependency = null])
object the delete (mixed $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 ([mixed $cacheModel = null], TSqlMapCacheModel $cacheModel.)

- TSqlMapCacheModel $cacheModel.

add (line 81)

- access: public
- throws: TSqlMapException not implemented.

void add (mixed $id, mixed $value, mixed $expire, [mixed $dependency = null])
delete (line 61)

- return: object removed if exists, null otherwise.
- access: public

object the delete (mixed $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, 22 Feb 2010 12:18:41 +0000 by phpDocumentor 1.3.0RC4