Callbacks

Callback function signatures. Drupal's API sometimes uses callback functions to allow you to define how some type of processing happens. A callback is a function with a defined signature, which you define in a module. Then you pass the function name as a parameter to a Drupal API function or return it as part of a hook implementation return value, and your function is called at an appropriate time. For instance, when setting up batch processing you might need to provide a callback function for

CalculatedCacheContextInterface::getContext

public CalculatedCacheContextInterface::getContext($parameter = NULL) Returns the string representation of the cache context. A cache context service's name is used as a token (placeholder) cache key, and is then replaced with the string returned by this method. Parameters string|null $parameter: The parameter, or NULL to indicate all possible parameter values. Return value string The string representation of the cache context. When $parameter is NULL, a value representing all possible parame

CalculatedCacheContextInterface

Provides an interface for defining a calculated cache context service. Hierarchy interface \Drupal\Core\Cache\Context\CalculatedCacheContextInterface File core/lib/Drupal/Core/Cache/Context/CalculatedCacheContextInterface.php, line 8 Namespace Drupal\Core\Cache\Context Members Name Modifiers Type Description CalculatedCacheContextInterface::getCacheableMetadata public function Gets the cacheability metadata for the context based on the parameter value. CalculatedCacheC

CalculatedCacheContextInterface::getLabel

public static CalculatedCacheContextInterface::getLabel() Returns the label of the cache context. Return value string The label of the cache context. See also Cache File core/lib/Drupal/Core/Cache/Context/CalculatedCacheContextInterface.php, line 18 Class CalculatedCacheContextInterface Provides an interface for defining a calculated cache context service. Namespace Drupal\Core\Cache\Context Code public static function getLabel();

CalculatedCacheContextInterface::getCacheableMetadata

public CalculatedCacheContextInterface::getCacheableMetadata($parameter = NULL) Gets the cacheability metadata for the context based on the parameter value. There are three valid cases for the returned CacheableMetadata object: An empty object means this can be optimized away safely. A max-age of 0 means that this context can never be optimized away. It will never bubble up and cache tags will not be used. Any non-zero max-age and cache tags will bubble up into the cache item if this is optimiz

CacheTagsInvalidator::resetChecksums

public CacheTagsInvalidator::resetChecksums() Reset statically cached tags in all cache tag checksum services. This is only used by tests. File core/lib/Drupal/Core/Cache/CacheTagsInvalidator.php, line 43 Class CacheTagsInvalidator Passes cache tag events to classes that wish to respond to them. Namespace Drupal\Core\Cache Code public function resetChecksums() { foreach ($this->invalidators as $invalidator) { if ($invalidator instanceof CacheTagsChecksumInterface) { $inv

CacheTagsInvalidator::invalidateTags

public CacheTagsInvalidator::invalidateTags(array $tags) Marks cache items with any of the specified tags as invalid. Parameters string[] $tags: The list of tags for which to invalidate cache items. Overrides CacheTagsInvalidatorInterface::invalidateTags File core/lib/Drupal/Core/Cache/CacheTagsInvalidator.php, line 24 Class CacheTagsInvalidator Passes cache tag events to classes that wish to respond to them. Namespace Drupal\Core\Cache Code public function invalidateTags(array $tags)

CacheTagsInvalidatorInterface::invalidateTags

public CacheTagsInvalidatorInterface::invalidateTags(array $tags) Marks cache items with any of the specified tags as invalid. Parameters string[] $tags: The list of tags for which to invalidate cache items. File core/lib/Drupal/Core/Cache/CacheTagsInvalidatorInterface.php, line 22 Class CacheTagsInvalidatorInterface Defines required methods for classes wanting to handle cache tag changes. Namespace Drupal\Core\Cache Code public function invalidateTags(array $tags);

CacheTagsInvalidator::getInvalidatorCacheBins

protected CacheTagsInvalidator::getInvalidatorCacheBins() Returns all cache bins that need to be notified about invalidations. Return value \Drupal\Core\Cache\CacheTagsInvalidatorInterface[] An array of cache backend objects that implement the invalidator interface, keyed by their cache bin. File core/lib/Drupal/Core/Cache/CacheTagsInvalidator.php, line 68 Class CacheTagsInvalidator Passes cache tag events to classes that wish to respond to them. Namespace Drupal\Core\Cache Code prote

CacheTagsInvalidatorInterface

Defines required methods for classes wanting to handle cache tag changes. Services that implement this interface must add the cache_tags_invalidator tag to be notified. Cache backends may implement this interface as well, they will be notified automatically. Hierarchy interface \Drupal\Core\Cache\CacheTagsInvalidatorInterface Related topics Cache API Information about the Drupal Cache API File core/lib/Drupal/Core/Cache/CacheTagsInvalidatorInterface.php, line 14 Namespace Drupal\Core\C