You are here

public function CacheFragmentController::generateCacheHash in RESTful 7.2

Generated the cache hash based on the cache fragments collection.

Parameters

ArrayCollection $cache_fragments: The collection of tags.

Return value

string The generated hash.

1 call to CacheFragmentController::generateCacheHash()
CacheFragmentController::createCacheFragments in src/RenderCache/Entity/CacheFragmentController.php
Creates all the caches tags from the tag collection.

File

src/RenderCache/Entity/CacheFragmentController.php, line 99
Contains \Drupal\restful\RenderCache\Entity\CacheFragmentController.

Class

CacheFragmentController
Class CacheFragmentController.

Namespace

Drupal\restful\RenderCache\Entity

Code

public function generateCacheHash(ArrayCollection $cache_fragments) {
  return substr(sha1(serialize($cache_fragments
    ->toArray())), 0, 40);
}