Drupal 8  8.0.2
CacheCollectorInterface Interface Reference
Inheritance diagram for CacheCollectorInterface:

Public Member Functions

 get ($key)
 
 set ($key, $value)
 
 delete ($key)
 
 has ($key)
 
 reset ()
 
 clear ()
 

Detailed Description

Provides a caching wrapper to be used in place of large structures.

This should be extended by systems that need to cache large amounts of data to calling functions. These structures can become very large, so this class is used to allow different strategies to be used for caching internally (lazy loading, building caches over time etc.). This can dramatically reduce the amount of data that needs to be loaded from cache backends on each request, and memory usage from static caches of that same data.

The default implementation is .

Member Function Documentation

clear ( )

Clears the collected cache entry.

Implemented in CacheCollector, and AliasWhitelist.

delete (   $key)

Deletes the element.

It depends on the specific case and implementation whether this has a permanent effect or if it just affects the current request.

Parameters
string$keyKey that identifies the data.

Implemented in CacheCollector.

get (   $key)

Gets value from the cache.

Parameters
string$keyKey that identifies the data.
Returns
mixed The corresponding cache data.

Implemented in CacheCollector, ThemeRegistry, and AliasWhitelist.

has (   $key)

Returns whether data exists for this key.

Parameters
string$keyKey that identifies the data.

Implemented in CacheCollector, and ThemeRegistry.

reset ( )

Resets the local cache.

Does not clear the persistent cache.

Implemented in CacheCollector, and LibraryDiscoveryCollector.

set (   $key,
  $value 
)

Sets cache data.

It depends on the specific case and implementation whether this has a permanent effect or if it just affects the current request.

Parameters
string$keyKey that identifies the data.
mixed$valueThe data to be set.

Implemented in CacheCollector, and CacheCollectorHelper.


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