Cache::buildTags

public static Cache::buildTags($prefix, array $suffixes, $glue = ':')

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.

File

core/lib/Drupal/Core/Cache/Cache.php, line 130

Class

Cache
Helper methods for cache.

Namespace

Drupal\Core\Cache

Code

public static function buildTags($prefix, array $suffixes, $glue = ':') {
  $tags = [];
  foreach ($suffixes as $suffix) {
    $tags[] = $prefix . $glue . $suffix;
  }
  return $tags;
}
doc_Drupal
2016-10-29 08:49:09
Comments
Leave a Comment

Please login to continue.