RedBeanModelsCache Class Reference

Inheritance diagram for RedBeanModelsCache:
ZurmoCache

Static Public Member Functions

static getModel ($modelIdentifier)
static cacheModel (RedBeanModel $model)
static forgetModel (RedBeanModel $model)
static forgetModelByIdentifier ($modelIdentifier)
static forgetAll ($onlyForgetPhpCache=false)
static forgetAllByModelType ($modelClassName)
static forgetAllModelIdentifiersToModels ()

Data Fields

const MAX_MODELS_CACHED_IN_MEMORY = 100

Static Public Attributes

static $cacheType = 'M:'

Detailed Description

Caches RedBean models. If caching is configured it the cached models outlive requests. Either way the models are cached in php for the duration of the current request. This allows multiple references to the same cached model, whether it came out of the memcache or not, to reference the same php object.

Definition at line 44 of file RedBeanModelsCache.php.


Member Function Documentation

static getModel ( modelIdentifier  )  [static]

Get a cached model.

Definition at line 55 of file RedBeanModelsCache.php.

static cacheModel ( RedBeanModel model  )  [static]

Cache a model maintaining the in memory model cache to a limited size.

Definition at line 102 of file RedBeanModelsCache.php.

static forgetModel ( RedBeanModel model  )  [static]

Forget a cached model.

Definition at line 129 of file RedBeanModelsCache.php.

static forgetAll ( onlyForgetPhpCache = false  )  [static]

Forget all cached models.

Parameters:
$onlyForgetPhpCache is for testing only. It is for artificially creating situations where memcache must be accessed for testing memcache and RedBeanModel serialization.

Definition at line 154 of file RedBeanModelsCache.php.

static forgetAllByModelType ( modelClassName  )  [static]

TODO: Only forget by model.

Parameters:
$modelClassName - string.

Definition at line 171 of file RedBeanModelsCache.php.

static forgetAllModelIdentifiersToModels (  )  [static]

Used for testing purposes if you need to clear out just the php caching.

Definition at line 180 of file RedBeanModelsCache.php.


The documentation for this class was generated from the following file:
 All Data Structures Functions Variables
Generated on Mon Jul 24 07:10:29 2017