Elgg  Version 6.2
Public Member Functions | Protected Attributes | List of all members
Elgg\Cache\QueryCache Class Reference

Volatile cache for select queries. More...

Inheritance diagram for Elgg\Cache\QueryCache:
Elgg\Cache\CacheService

Public Member Functions

 __construct (protected Config $config)
 Constructor. More...
 
 purge ()
 {Purges the caches.
Returns
void
} More...
 
 invalidate ()
 {Invalidates the caches.
Returns
void
} More...
 
 clear ()
 {Clears the caches.
Returns
void
} More...
 
 save (string $key, mixed $data, null|int|\DateTime $expire_after=null)
 {Saves data in the cache.
Parameters
string$keyIdentifier of the cached item
mixed$dataThe data to be saved
int | \DateTime | null$expire_afterNumber of seconds to expire the cache after
Returns
bool
} More...
 
 load (string $key)
 {Retrieve the contents of a cached item.
Parameters
string$keyIdentifier of the cached item
Returns
mixed null if key not found in cache
} More...
 
 delete (string $key)
 {Deletes the contents of a cached item.
Parameters
string$keyIdentifier of the cached item
Returns
bool
} More...
 
- Public Member Functions inherited from Elgg\Cache\CacheService
 isEnabled ()
 Is the cache enabled. More...
 
 enable ()
 Enables the cache. More...
 
 disable ()
 Disables the cache. More...
 

Protected Attributes

int $query_cache_limit = 50
 
array $keys = []
 
- Protected Attributes inherited from Elgg\Cache\CacheService
CompositeCache $cache
 
bool $enabled = true
 

Detailed Description

Volatile cache for select queries.

Definition at line 12 of file QueryCache.php.

Constructor & Destructor Documentation

◆ __construct()

Elgg\Cache\QueryCache::__construct ( protected Config  $config)

Constructor.

Parameters
Config$configElgg config

Definition at line 23 of file QueryCache.php.

Member Function Documentation

◆ clear()

Elgg\Cache\QueryCache::clear ( )

{Clears the caches.

Returns
void
}

Reimplemented from Elgg\Cache\CacheService.

Definition at line 55 of file QueryCache.php.

◆ delete()

Elgg\Cache\QueryCache::delete ( string  $key)

{Deletes the contents of a cached item.

Parameters
string$keyIdentifier of the cached item
Returns
bool
}

Reimplemented from Elgg\Cache\CacheService.

Definition at line 93 of file QueryCache.php.

◆ invalidate()

Elgg\Cache\QueryCache::invalidate ( )

{Invalidates the caches.

Returns
void
}

Reimplemented from Elgg\Cache\CacheService.

Definition at line 46 of file QueryCache.php.

◆ load()

Elgg\Cache\QueryCache::load ( string  $key)

{Retrieve the contents of a cached item.

Parameters
string$keyIdentifier of the cached item
Returns
mixed null if key not found in cache
}

Reimplemented from Elgg\Cache\CacheService.

Definition at line 80 of file QueryCache.php.

◆ purge()

Elgg\Cache\QueryCache::purge ( )

{Purges the caches.

Returns
void
}

Reimplemented from Elgg\Cache\CacheService.

Definition at line 37 of file QueryCache.php.

◆ save()

Elgg\Cache\QueryCache::save ( string  $key,
mixed  $data,
null|int|\DateTime  $expire_after = null 
)

{Saves data in the cache.

Parameters
string$keyIdentifier of the cached item
mixed$dataThe data to be saved
int | \DateTime | null$expire_afterNumber of seconds to expire the cache after
Returns
bool
}

Reimplemented from Elgg\Cache\CacheService.

Definition at line 64 of file QueryCache.php.

Member Data Documentation

◆ $keys

array Elgg\Cache\QueryCache::$keys = []
protected

Definition at line 16 of file QueryCache.php.

◆ $query_cache_limit

int Elgg\Cache\QueryCache::$query_cache_limit = 50
protected

Definition at line 14 of file QueryCache.php.


The documentation for this class was generated from the following file: