function Cache::buildTags
Same name in other branches
- 9 core/lib/Drupal/Core/Cache/Cache.php \Drupal\Core\Cache\Cache::buildTags()
- 8.9.x core/lib/Drupal/Core/Cache/Cache.php \Drupal\Core\Cache\Cache::buildTags()
- 11.x core/lib/Drupal/Core/Cache/Cache.php \Drupal\Core\Cache\Cache::buildTags()
Build an array of cache tags from a given prefix and an array of suffixes.
Each suffix will be converted to a cache tag by appending it to the prefix, with a colon between them.
Parameters
string $prefix: A prefix string.
array $suffixes: An array of suffixes. Will be cast to strings.
string $glue: A string to be used as glue for concatenation. Defaults to a colon.
Return value
string[] An array of cache tags.
5 calls to Cache::buildTags()
- CacheTest::testBuildTags in core/
tests/ Drupal/ Tests/ Core/ Cache/ CacheTest.php - @covers ::buildTags
- MenuTreeStorage::rebuild in core/
lib/ Drupal/ Core/ Menu/ MenuTreeStorage.php - MenuTreeStorage::save in core/
lib/ Drupal/ Core/ Menu/ MenuTreeStorage.php - node_title_list in core/
modules/ node/ node.module - Gathers a listing of links to nodes.
- workspaces_menu_link_content_update in core/
modules/ workspaces/ workspaces.module - Implements hook_ENTITY_TYPE_update() for the 'menu_link_content' entity type.
File
-
core/
lib/ Drupal/ Core/ Cache/ Cache.php, line 96
Class
- Cache
- Helper methods for cache.
Namespace
Drupal\Core\CacheCode
public static function buildTags($prefix, array $suffixes, $glue = ':') {
$tags = [];
foreach ($suffixes as $suffix) {
$tags[] = $prefix . $glue . $suffix;
}
return $tags;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.