Ubiquity 2.5.2
php rapid development framework
Loading...
Searching...
No Matches
DbCache Class Reference

Abstract class for database caching Ubiquity\cache\database$DbCache This class is part of Ubiquity. More...

+ Inheritance diagram for DbCache:

Public Member Functions

 __construct ($cacheSystem=ArrayCache::class, $config=[])
 
 store ($tableName, $condition, $result)
 Caches the given data with the given key (tableName+md5(condition)).
 
 fetch ($tableName, $condition)
 Fetches data stored for the given condition in table.
 
 delete ($tableName, $condition)
 Deletes the entry corresponding to $condition apply to $table.
 
 clear ($matches='')
 
 remove ($key)
 
 setActive ($value=true)
 
 storeDeferred ()
 

Static Public Attributes

static $active = false
 

Protected Member Functions

 getKey ($tableName, $condition)
 
 getMemoryCache ($key)
 

Protected Attributes

 $cache
 
 $memoryCache
 
 $storeDeferred
 
 $toStore = [ ]
 

Detailed Description

Abstract class for database caching Ubiquity\cache\database$DbCache This class is part of Ubiquity.

Author
jcheron myadd.nosp@m.ress.nosp@m.mail@.nosp@m.gmai.nosp@m.l.com
Version
1.0.1

Definition at line 20 of file DbCache.php.

Constructor & Destructor Documentation

◆ __construct()

__construct (   $cacheSystem = ArrayCache::class,
  $config = [ ] 
)

Definition at line 35 of file DbCache.php.

Member Function Documentation

◆ clear()

clear (   $matches = '')

Definition at line 90 of file DbCache.php.

◆ delete()

delete (   $tableName,
  $condition 
)
abstract

Deletes the entry corresponding to $condition apply to $table.

Parameters
string$tableName
string$condition
Returns
boolean true if the entry is deleted

Reimplemented in MemoryCache, and QueryCache.

◆ fetch()

fetch (   $tableName,
  $condition 
)

Fetches data stored for the given condition in table.

Parameters
string$tableName
string$condition
Returns
mixed the cached datas

Reimplemented in MemoryCache.

Definition at line 70 of file DbCache.php.

◆ getKey()

getKey (   $tableName,
  $condition 
)
protected

Definition at line 31 of file DbCache.php.

◆ getMemoryCache()

getMemoryCache (   $key)
protected

Definition at line 44 of file DbCache.php.

◆ remove()

remove (   $key)

Definition at line 94 of file DbCache.php.

◆ setActive()

setActive (   $value = true)

Definition at line 98 of file DbCache.php.

◆ store()

store (   $tableName,
  $condition,
  $result 
)
abstract

Caches the given data with the given key (tableName+md5(condition)).

Parameters
string$tableName
string$condition
array$resultthe datas to store

Reimplemented in MemoryCache, and QueryCache.

◆ storeDeferred()

storeDeferred ( )

Definition at line 102 of file DbCache.php.

Field Documentation

◆ $active

$active = false
static

Definition at line 29 of file DbCache.php.

◆ $cache

$cache
protected

Definition at line 21 of file DbCache.php.

◆ $memoryCache

$memoryCache
protected

Definition at line 26 of file DbCache.php.

◆ $storeDeferred

$storeDeferred
protected

Definition at line 27 of file DbCache.php.

◆ $toStore

$toStore = [ ]
protected

Definition at line 28 of file DbCache.php.


The documentation for this class was generated from the following file: