Mage_Core_Model_Cache
in package
Table of Contents
Constants
- DEFAULT_LIFETIME : mixed = 7200
- Cache settings
- INVALIDATED_TYPES : mixed = 'core_cache_invalidate'
- OPTIONS_CACHE_ID : mixed = 'core_cache_options'
- XML_PATH_TYPES : mixed = 'global/cache/types'
Properties
- $_idPrefix : string
- $allowedCacheOptions : array<string|int, mixed>|null
- $cacheAdapter : AbstractTagAwareAdapter
- Cache frontend API
- $defaultAdapter : string
- $defaultAdapterOptions : array<string|int, mixed>
Methods
- __construct() : mixed
- Class constructor. Initialize cache instance based on options
- banUse() : $this
- Disable cache usage for specific data type
- canUse() : bool|array<string|int, mixed>
- Check if cache can be used for specific data type
- clean() : bool
- Clean cached data by specific tag
- cleanType() : $this
- Clean cached data for specific cache type
- flush() : bool
- getCacheAdapter() : AbstractTagAwareAdapter
- getInvalidatedTypes() : array<string|int, mixed>
- Get array of all invalidated cache types
- getTagsByType() : array<string|int, mixed>
- Get cache tags by cache type from configuration
- getTypes() : array<string|int, mixed>
- Get information about all declared cache types
- invalidateType() : $this
- Mark specific cache type(s) as invalidated
- load() : mixed
- Load data from cache by id
- prune() : bool
- remove() : bool
- Remove cached data by identifier
- save() : bool
- saveOptions() : self
- Save cache usage options
- test() : bool
- Check if a key is a cache hit
- unbanUse() : $this
- Enable cache usage for specific data type
- _getInvalidatedTypes() : array<string|int, mixed>
- Get invalidate types codes
- _getResource() : Mage_Core_Model_Resource_Cache
- Get cache resource model
- _id() : string
- Prepare unified valid identifier with prefix
- _initOptions() : $this
- Initialize cache types options
- _saveInvalidatedTypes() : $this
- Save invalidated cache types
- _tags() : array<string|int, mixed>
- Prepare cache tags.
- getCacheAdapterOptions() : array<string|int, mixed>
Constants
DEFAULT_LIFETIME
Cache settings
public
mixed
DEFAULT_LIFETIME
= 7200
INVALIDATED_TYPES
public
mixed
INVALIDATED_TYPES
= 'core_cache_invalidate'
OPTIONS_CACHE_ID
public
mixed
OPTIONS_CACHE_ID
= 'core_cache_options'
XML_PATH_TYPES
public
mixed
XML_PATH_TYPES
= 'global/cache/types'
Properties
$_idPrefix
protected
string
$_idPrefix
= ''
$allowedCacheOptions
protected
array<string|int, mixed>|null
$allowedCacheOptions
= \null
$cacheAdapter
Cache frontend API
protected
AbstractTagAwareAdapter
$cacheAdapter
Tags
$defaultAdapter
protected
string
$defaultAdapter
= 'file'
$defaultAdapterOptions
protected
array<string|int, mixed>
$defaultAdapterOptions
= []
Methods
__construct()
Class constructor. Initialize cache instance based on options
public
__construct([array<string|int, mixed> $options = [] ]) : mixed
Parameters
- $options : array<string|int, mixed> = []
banUse()
Disable cache usage for specific data type
public
banUse(string $typeCode) : $this
Parameters
- $typeCode : string
Return values
$thiscanUse()
Check if cache can be used for specific data type
public
canUse(string $typeCode) : bool|array<string|int, mixed>
Parameters
- $typeCode : string
Return values
bool|array<string|int, mixed>clean()
Clean cached data by specific tag
public
clean([array<string|int, mixed>|string $tags = [] ]) : bool
Parameters
- $tags : array<string|int, mixed>|string = []
Return values
boolcleanType()
Clean cached data for specific cache type
public
cleanType(string $typeCode) : $this
Parameters
- $typeCode : string
Return values
$thisflush()
public
flush() : bool
Return values
boolgetCacheAdapter()
public
getCacheAdapter() : AbstractTagAwareAdapter
Return values
AbstractTagAwareAdaptergetInvalidatedTypes()
Get array of all invalidated cache types
public
getInvalidatedTypes() : array<string|int, mixed>
Return values
array<string|int, mixed>getTagsByType()
Get cache tags by cache type from configuration
public
getTagsByType(string $type) : array<string|int, mixed>
Parameters
- $type : string
Return values
array<string|int, mixed>getTypes()
Get information about all declared cache types
public
getTypes() : array<string|int, mixed>
Return values
array<string|int, mixed>invalidateType()
Mark specific cache type(s) as invalidated
public
invalidateType(string|array<string|int, mixed> $typeCode) : $this
Parameters
- $typeCode : string|array<string|int, mixed>
Return values
$thisload()
Load data from cache by id
public
load(string $id) : mixed
Parameters
- $id : string
prune()
public
prune() : bool
Return values
boolremove()
Remove cached data by identifier
public
remove(string $id) : bool
Parameters
- $id : string
Return values
boolsave()
public
save(mixed $data, string $id[, array<string|int, mixed> $tags = [] ][, int|null $lifeTime = null ]) : bool
Parameters
- $data : mixed
- $id : string
- $tags : array<string|int, mixed> = []
- $lifeTime : int|null = null
Return values
boolsaveOptions()
Save cache usage options
public
saveOptions(array<string|int, mixed> $options) : self
Parameters
- $options : array<string|int, mixed>
Return values
selftest()
Check if a key is a cache hit
public
test(string $id) : bool
Parameters
- $id : string
Return values
boolunbanUse()
Enable cache usage for specific data type
public
unbanUse(string $typeCode) : $this
Parameters
- $typeCode : string
Return values
$this_getInvalidatedTypes()
Get invalidate types codes
protected
_getInvalidatedTypes() : array<string|int, mixed>
Return values
array<string|int, mixed>_getResource()
Get cache resource model
protected
_getResource() : Mage_Core_Model_Resource_Cache
Return values
Mage_Core_Model_Resource_Cache_id()
Prepare unified valid identifier with prefix
protected
_id(string $id) : string
Parameters
- $id : string
Return values
string_initOptions()
Initialize cache types options
protected
_initOptions() : $this
Return values
$this_saveInvalidatedTypes()
Save invalidated cache types
protected
_saveInvalidatedTypes(array<string|int, mixed> $types) : $this
Parameters
- $types : array<string|int, mixed>
Return values
$this_tags()
Prepare cache tags.
protected
_tags([array<string|int, mixed> $tags = [] ]) : array<string|int, mixed>
Parameters
- $tags : array<string|int, mixed> = []
Return values
array<string|int, mixed>getCacheAdapterOptions()
protected
getCacheAdapterOptions(array<string|int, mixed> $cacheOptions) : array<string|int, mixed>
Parameters
- $cacheOptions : array<string|int, mixed>