trait ManagesCache

Properties

static protected CacheManager $cache

The cache manager instance.

protected bool $loadedFromCache

Methods

static CacheManager
getCacheManager()

Get the cache manager instance.

static void
setCacheManager(CacheManager $cache)

Set the cache manager instance.

static void
unsetCacheManager()

Unset the cache manager for models.

static 
initCacheItem($item)

Initializes the object properties from the cached data. The extra data set here becomes available as attributes set on the model after fetch.

bool
isLoadedFromCache()

Returns true if the object was loaded from the cache.

void
setLoadedFromCache($value)

Returns true if the object was loaded from the cache.

Details

at line 22
static CacheManager getCacheManager()

Get the cache manager instance.

Return Value

CacheManager

at line 34
static void setCacheManager(CacheManager $cache)

Set the cache manager instance.

Parameters

CacheManager $cache

Return Value

void

at line 43
static void unsetCacheManager()

Unset the cache manager for models.

Return Value

void

at line 54
static initCacheItem($item)

Initializes the object properties from the cached data. The extra data set here becomes available as attributes set on the model after fetch.

Parameters

$item

at line 62
bool isLoadedFromCache()

Returns true if the object was loaded from the cache.

Return Value

bool

at line 74
void setLoadedFromCache($value)

Returns true if the object was loaded from the cache.

Parameters

$value

Return Value

void