## 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 1568 2006-12-09 09:17:22Z wei $
- 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 $_cacheSize
mixed $_keyList
Method Summary
TSqlMapCache __construct ([integer $cacheSize = 100])
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 $_cacheSize = 100 (line 27)

- access: protected

mixed $_keyList (line 25)

- access: protected

Methods
Constructor __construct (line 33)

Create a new cache with limited cache size.

- access: public

TSqlMapCache __construct ([integer $cacheSize = 100])

- integer $cacheSize: maxium number of items to cache.

add (line 80)

- access: public
- throws: TSqlMapException not implemented.

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

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

object the delete (mixed $key)
flush (line 71)

Clears the cache.

- access: public

void flush ()
getCacheSize (line 52)

- return: cache size.
- access: public

int getCacheSize ()
setCacheSize (line 44)

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

- access: public

void setCacheSize (int $value)

- int $value: cache size.

Documentation generated on Sun, 14 Jan 2007 21:44:22 -0500 by phpDocumentor 1.3.0RC4