PHP Trait Rinvex\Repository\Traits\Cacheable

Afficher le fichier Open project: rinvex/repository

Protected Properties

Свойство Type Description
$cacheClearEnabled boolean Indicate if the repository cache clear is enabled.
$cacheDriver string The repository cache driver.
$cacheLifetime float | integer The repository cache lifetime.

Méthodes publiques

Méthode Description
enableCacheClear ( boolean $status = true ) Enable repository cache clear.
forgetCache ( ) Forget the repository cache.
getCacheDriver ( ) : string Get the repository cache driver.
getCacheLifetime ( ) : float | integer Get the repository cache lifetime.
isCacheClearEnabled ( ) : boolean Determine if repository cache clear is enabled.
setCacheDriver ( string $cacheDriver ) Set the repository cache driver.
setCacheLifetime ( float | integer $cacheLifetime ) Set the repository cache lifetime.

Méthodes protégées

Méthode Description
cacheCallback ( string $class, string $method, array $args, Closure $closure ) : mixed Cache given callback.
flushCacheKeys ( ) : array Flush cache keys by mimicking cache tags.
generateCacheHash ( $args ) : string Generate unique query hash.
getCacheKeys ( string $file ) : array Get cache keys.
resetCachedRepository ( ) Reset cached repository to it's defaults.
storeCacheKeys ( string $class, string $method, string $hash ) : void Store cache keys by mimicking cache tags.

Method Details

cacheCallback() protected méthode

Cache given callback.
protected cacheCallback ( string $class, string $method, array $args, Closure $closure ) : mixed
$class string
$method string
$args array
$closure Closure
Résultat mixed

enableCacheClear() public méthode

Enable repository cache clear.
public enableCacheClear ( boolean $status = true )
$status boolean

flushCacheKeys() protected méthode

Flush cache keys by mimicking cache tags.
protected flushCacheKeys ( ) : array
Résultat array

forgetCache() public méthode

Forget the repository cache.
public forgetCache ( )

generateCacheHash() protected méthode

Generate unique query hash.
protected generateCacheHash ( $args ) : string
$args
Résultat string

getCacheDriver() public méthode

Get the repository cache driver.
public getCacheDriver ( ) : string
Résultat string

getCacheKeys() protected méthode

Get cache keys.
protected getCacheKeys ( string $file ) : array
$file string
Résultat array

getCacheLifetime() public méthode

Get the repository cache lifetime.
public getCacheLifetime ( ) : float | integer
Résultat float | integer

isCacheClearEnabled() public méthode

Determine if repository cache clear is enabled.
public isCacheClearEnabled ( ) : boolean
Résultat boolean

resetCachedRepository() protected méthode

Reset cached repository to it's defaults.
protected resetCachedRepository ( )

setCacheDriver() public méthode

Set the repository cache driver.
public setCacheDriver ( string $cacheDriver )
$cacheDriver string

setCacheLifetime() public méthode

Set the repository cache lifetime.
public setCacheLifetime ( float | integer $cacheLifetime )
$cacheLifetime float | integer

storeCacheKeys() protected méthode

Store cache keys by mimicking cache tags.
protected storeCacheKeys ( string $class, string $method, string $hash ) : void
$class string
$method string
$hash string
Résultat void

Property Details

$cacheClearEnabled protected_oe property

Indicate if the repository cache clear is enabled.
protected bool $cacheClearEnabled
Résultat boolean

$cacheDriver protected_oe property

The repository cache driver.
protected string $cacheDriver
Résultat string

$cacheLifetime protected_oe property

The repository cache lifetime.
protected float|int $cacheLifetime
Résultat float | integer