trait Cache

Properties

string $cachePrefix

Prefix for cache keys.

int|null $cacheTimeStamp

Timestamp of the cached data.

Methods

void
setCachePrefix(string $string)

Set the cache prefix.

string
getCacheKey()

Generate a unique cache key for the current user and table.

void
cacheData()

Cache the current user data.

void
clearData()

Clear the cached data for this table.

mixed
getCachedData()

Retrieve cached data.

void
updateCacheData(mixed $data)

Update the cached data with new data.

Details

at line 31
void setCachePrefix(string $string)

Set the cache prefix.

Parameters

string $string

The prefix string.

Return Value

void

at line 41
protected string getCacheKey()

Generate a unique cache key for the current user and table.

Return Value

string

at line 54
void cacheData()

Cache the current user data.

Stores the data in the cache for 60 minutes and updates the timestamp.

Return Value

void

at line 68
void clearData()

Clear the cached data for this table.

Return Value

void

at line 80
mixed getCachedData()

Retrieve cached data.

If cache is missing, it attempts to re-initialize the component (mount).

Return Value

mixed

The cached data.

at line 96
void updateCacheData(mixed $data)

Update the cached data with new data.

Clears current selection and updates the cache with the new data set.

Parameters

mixed $data

The new data to cache.

Return Value

void