You are here

function _toolbar_get_subtrees_hash in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/toolbar/toolbar.module \_toolbar_get_subtrees_hash()
  2. 9 core/modules/toolbar/toolbar.module \_toolbar_get_subtrees_hash()

Returns the hash of the user-rendered toolbar subtrees and cacheability.

Return value

array An array with the hash of the toolbar subtrees and cacheability.

2 calls to _toolbar_get_subtrees_hash()
ToolbarController::checkSubTreeAccess in core/modules/toolbar/src/Controller/ToolbarController.php
Checks access for the subtree controller.
toolbar_toolbar in core/modules/toolbar/toolbar.module
Implements hook_toolbar().

File

core/modules/toolbar/toolbar.module, line 296
Administration toolbar for quick access to top level administration items.

Code

function _toolbar_get_subtrees_hash() {
  [
    $subtrees,
    $cacheability,
  ] = toolbar_get_rendered_subtrees();
  $hash = Crypt::hashBase64(serialize($subtrees));
  return [
    $hash,
    $cacheability,
  ];
}