function Registry::cacheGet

Same name in other branches
  1. 10 core/lib/Drupal/Core/Theme/Registry.php \Drupal\Core\Theme\Registry::cacheGet()

Gets the theme registry cache.

Return value

array|null

1 call to Registry::cacheGet()
Registry::get in core/lib/Drupal/Core/Theme/Registry.php
Returns the complete theme registry from cache or rebuilds it.

File

core/lib/Drupal/Core/Theme/Registry.php, line 291

Class

Registry
Defines the theme registry service.

Namespace

Drupal\Core\Theme

Code

protected function cacheGet() : ?array {
    $theme_name = $this->theme
        ->getName();
    if (isset($this->registry[$theme_name])) {
        return $this->registry[$theme_name];
    }
    elseif ($cache = $this->cache
        ->get('theme_registry:' . $theme_name)) {
        $this->registry[$theme_name] = $cache->data;
        return $this->registry[$theme_name];
    }
    return NULL;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.