BlockCacheStrategyInterface
in
A cache strategy will cache a block differently according to various options
Table of Contents
- buildKey() : array<string|int, mixed>
- Get the cache key elements specific to this strategy
- getCache() : string|null
- get a block cache data.
- getDescription() : string
- Get strategy description
- getDuration() : int|null
- Get cache duration (seconds).
- getHandle() : string
- Get strategy handle
- getName() : string
- Get strategy name
- getOptions() : BlockStrategyOptions
- Get options model (populated)
- setCache() : mixed
- Set a block cache
Methods
buildKey()
Get the cache key elements specific to this strategy
public
buildKey(BlockInterface $block) : array<string|int, mixed>
Parameters
- $block : BlockInterface
Return values
array<string|int, mixed> —getCache()
get a block cache data.
public
getCache(BlockInterface $block) : string|null
Returns null if cache is not set.
Parameters
- $block : BlockInterface
Return values
string|null —getDescription()
Get strategy description
public
getDescription() : string
Return values
string —getDuration()
Get cache duration (seconds).
public
getDuration() : int|null
Returning null will use Yii default caching duration. 0 means infinity.
Return values
int|null —getHandle()
Get strategy handle
public
getHandle() : string
Return values
string —getName()
Get strategy name
public
getName() : string
Return values
string —getOptions()
Get options model (populated)
public
getOptions() : BlockStrategyOptions
Return values
BlockStrategyOptions —setCache()
Set a block cache
public
setCache(BlockInterface $block, string $data, TagDependency $dep) : mixed
Parameters
- $block : BlockInterface
- $data : string
- $dep : TagDependency