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 TSqlMapCacheModel

TSqlMapCacheModel corresponds to the <cacheModel> sql mapping configuration tag.

The results from a query Mapped Statement can be cached simply by specifying the CacheModel TSqlMapStatement::setCacheModel() property in <statement> tag. A cache model is a configured cache that is defined within the sql map configuration file. Cache models are configured using the <cacheModel> element.

The cache model uses a pluggable framework for supporting different types of caches. The choice of cache is specified by the Implementation setImplementation() property. The class name specified must be one of 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.

TComponent
Extended by TSqlMapCacheModel
Package: System\Data\SqlMap\Configuration
Copyright: Copyright © 2005-2014 PradoSoft
License: http://www.pradosoft.com/license/
Author: Wei Zhuo <weizho[at]gmail[dot]com>
Since: 3.1
Located at Data/SqlMap/Configuration/TSqlMapCacheModel.php
Methods summary
public static
# registerCacheType( mixed $type, mixed $className )
public string
# getID( )

Returns

string
unique cache model identifier.
public
# setID( string $value )

Parameters

$value
string
unique cache model identifier.
public string
# getImplementation( )

Returns

string
cache implements of TSqlMapCacheTypes, either 'Basic', 'LRU' or 'FIFO'.
public
# setImplementation( string $value )

Parameters

$value
string
cache implements of TSqlMapCacheTypes, either 'Basic', 'LRU' or 'FIFO'.
public
# setFlushInterval( integer $value )

Parameters

$value
integer
the number of seconds in which the cached value will expire. 0 means never expire.
public integer
# getFlushInterval( )

Returns

integer
cache duration.
public
# initialize( ISqLMapCache $cache = null )

Initialize the cache implementation, sets the actual cache contain if supplied.

Initialize the cache implementation, sets the actual cache contain if supplied.

Parameters

$cache
ISqLMapCache
cache implementation instance.
public string
# getImplementationClass( )

Returns

string
cache implementation class name.
public
# registerTriggerStatement( TMappedStatement $mappedStatement )

Register a mapped statement that will trigger a cache flush.

Register a mapped statement that will trigger a cache flush.

Parameters

$mappedStatement
TMappedStatement
mapped statement that may flush the cache.
public
# flush( )

Clears the cache.

Clears the cache.

public mixed
# get( TSqlMapCacheKey|string $key )

Parameters

$key
TSqlMapCacheKey|string
cache key

Returns

mixed
cached value.
public
# set( TSqlMapCacheKey|string $key, mixed $value )

Parameters

$key
TSqlMapCacheKey|string
cache key
$value
mixed
value to be cached.
public float
# getHitRatio( )

Returns

float
cache hit ratio.
Methods inherited from TComponent
__call(), __construct(), __destruct(), __get(), __isset(), __set(), __sleep(), __unset(), __wakeup(), addParsedObject(), asa(), attachBehavior(), attachBehaviors(), attachClassBehavior(), attachEventHandler(), canGetProperty(), canSetProperty(), clearBehaviors(), createdOnTemplate(), detachBehavior(), detachBehaviors(), detachClassBehavior(), detachEventHandler(), disableBehavior(), disableBehaviors(), enableBehavior(), enableBehaviors(), evaluateExpression(), evaluateStatements(), fxAttachClassBehavior(), fxDetachClassBehavior(), getAutoGlobalListen(), getBehaviorsEnabled(), getClassHierarchy(), getEventHandlers(), getListeningToGlobalEvents(), getSubProperty(), hasEvent(), hasEventHandler(), hasProperty(), isa(), listen(), raiseEvent(), setSubProperty(), unlisten()
Constants inherited from TComponent
GLOBAL_RAISE_EVENT_LISTENER
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