You are here

function icon_provider_load in Icon API 8

Same name and namespace in other branches
  1. 7 icon.module \icon_provider_load()

Load a specific provider.

Parameters

string $name: The name of the provider to load.

Return value

array An associative array of provider information as returned from icon_providers().

2 calls to icon_provider_load()
hook_icon_PROVIDER_import_validate in ./icon.api.php
Validate callback for 'hook_icon_PROVIDER_import_process'.
theme_icon_bundle_overview_form in includes/admin.inc
Theme implementation for 'icon_bundle_overview_form'.

File

./icon.module, line 713
icon.module Provides icon integration with menu items.

Code

function icon_provider_load($name) {
  $loaded =& drupal_static(__FUNCTION__, array());
  if (empty($loaded[$name])) {
    if (($cache = \Drupal::cache('cache_icon_providers')
      ->get($name)) && !empty($cache->data)) {
      $loaded[$name] = $cache->data;
    }
    else {
      $provider = icon_providers($name);
      \Drupal::cache('cache_icon_providers')
        ->set($name, $provider);
      $loaded[$name] = $provider;
    }
  }
  return $loaded[$name];
}