PRADO Component Framework for PHP 5
  • Home
  • About
  • Testimonials
  • Demos
  • Download
  • Documentation
  • Forum
  • Development
  • Tutorials
  • Class Docs
  • API Manual
  • Wiki

Packages

  • None
  • System
    • Caching
    • Collections
    • Data
      • ActiveRecord
        • Relations
        • Scaffold
          • InputBuilder
      • Commom
        • Sqlite
      • Common
        • Mssql
        • Mysql
        • Oracle
        • Pgsql
        • Sqlite
      • DataGateway
      • SqlMap
        • Configuration
        • Statements
    • Exceptions
    • I18N
    • IO
    • Security
    • Util
    • Web
      • Javascripts
      • Services
      • UI
        • ActiveControls
        • WebControls
    • Xml
  • Wsat
    • pages
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo

Class TSqlMapCache

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

TSqlMapCache implements ICache

Direct known subclasses

TSqlMapFifoCache, TSqlMapLruCache
Abstract
Package: System\Data\SqlMap
Copyright: Copyright © 2005-2014 PradoSoft
License: http://www.pradosoft.com/license/
Author: Wei Zhuo <weizhuo[at]gmail[dot]com>
Since: 3.1
Located at Data/SqlMap/DataMapper/TSqlMapCache.php
Methods summary
public
# __construct( TSqlMapCacheModel $cacheModel = null )

Create a new cache with limited cache size.

Create a new cache with limited cache size.

Parameters

$cacheModel
TSqlMapCacheModel
$cacheModel.
public
# setCacheSize( integer $value )

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

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

Parameters

$value
integer
cache size.
public integer
# getCacheSize( )

Returns

integer
cache size.
public object
# delete( string $key )

Parameters

$key
string
the key of the value to be deleted

Returns

object
the object removed if exists, null otherwise.

Implementation of

ICache::delete()
public
# flush( )

Clears the cache.

Clears the cache.

Implementation of

ICache::flush()
public boolean
# add( string $id, mixed $value, integer $expire = 0, ICacheDependency $dependency = null )

Parameters

$id
string
the key identifying the value to be cached
$value
mixed
the value to be cached
$expire
integer
the number of seconds in which the cached value will expire. 0 means never expire.
$dependency
ICacheDependency
dependency of the cached item. If the dependency changes, the item is labelled invalid.

Returns

boolean
true if the value is successfully stored into cache, false otherwise

Throws

TSqlMapException
not implemented.

Implementation of

ICache::add()
Methods inherited from ICache
get(), set()
Properties summary
protected mixed $_keyList
#
protected mixed $_cache
#
protected integer $_cacheSize 100
#
protected mixed $_cacheModel null
#
Terms of Service | Contact Us
PRADO v3.2.4 API Manual API documentation generated by ApiGen 2.8.0
Copyright © 2006-2014 by the PRADO Group.
Powered by PRADO