RedBeanModelsCache Class Reference

Inheritance diagram for RedBeanModelsCache:

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


Static Public Attributes

static $cacheType = 'M:'

Static Protected Member Functions

static supportsAndAllowsMemcacheByModel (RedBeanModel $model)
static supportsAndAllowsMemcacheByModelClassName ($modelClassName)
static supportsAndAllowsMemcacheByModelIdentifier ($modelIndetifier)

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 80 of file RedBeanModelsCache.php.

static forgetModel ( RedBeanModel model  )  [static]

Forget a cached model.

Definition at line 103 of file RedBeanModelsCache.php.

static forgetAll ( onlyForgetPhpCache = false  )  [static]

Forget all cached models.

$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 128 of file RedBeanModelsCache.php.

static forgetAllByModelType ( modelClassName  )  [static]

TODO: Only forget by model.

$modelClassName - string.

Definition at line 144 of file RedBeanModelsCache.php.

static forgetAllModelIdentifiersToModels (  )  [static]

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

Definition at line 153 of file RedBeanModelsCache.php.

The documentation for this class was generated from the following file:
 All Data Structures Functions Variables
Generated on Wed Nov 20 07:11:19 2019