Cache::mergeContexts

public static Cache::mergeContexts(array $a = [], array $b = [])

Merges arrays of cache contexts and removes duplicates.

Parameters

array $a: Cache contexts array to merge.

array $b: Cache contexts array to merge.

Return value

string[] The merged array of cache contexts.

File

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

Class

Cache
Helper methods for cache.

Namespace

Drupal\Core\Cache

Code

public static function mergeContexts(array $a = [], array $b = []) {
  $cache_contexts = array_unique(array_merge($a, $b));
  assert('\Drupal::service(\'cache_contexts_manager\')->assertValidTokens($cache_contexts)');
  sort($cache_contexts);
  return $cache_contexts;
}
doc_Drupal
2016-10-29 08:49:10
Comments
Leave a Comment

Please login to continue.