You are here

function facetapi_adapter_info_get in Facet API 6

Invokes hook_facetapi_adapter_info(), returns all adapter definitions.

Parameters

$reset: A boolean flagging whether the static should be reset.

Return value

An array of adapter definitions.

3 calls to facetapi_adapter_info_get()
facetapi_adapter_load in ./facetapi.module
Returns a searcher module's adapter class.
facetapi_block_info in ./facetapi.widget.inc
Returns data for the "list" operation of hook_block().
facetapi_delta_map_get in ./facetapi.widget.inc
Returns a "delta map", because sometimes our deltas are longer than 32 chars and need to be passed to md5(). Due to the block table's schema, deltas cannot be longer than 32 characters. However, md5 hashes are nasty as CSS IDs, so we…

File

./facetapi.module, line 292
An abstracted facet API that can be used by various search backens.

Code

function facetapi_adapter_info_get($reset = FALSE) {
  static $adapters;
  if (NULL === $adapters || $reset) {
    module_load_include('inc', 'facetapi', 'facetapi.adapter');

    // Gets adapters from hooks.
    $adapters = array();
    foreach (module_implements('facetapi_adapter_info') as $module) {
      if (($result = module_invoke($module, 'facetapi_adapter_info')) && is_array($result)) {
        foreach ($result as $searcher => $adapter) {
          $defaults = array(
            'module' => $module,
            'class' => 'FacetapiAdapter',
            'type' => 'node',
            'file' => '',
            'file path' => drupal_get_path('module', $module),
          );
          $adapters[$searcher] = array_merge($defaults, $adapter);
        }
      }
    }

    // Allows modules to alter the adapter definitions.
    drupal_alter('facetapi_adapter_info', $adapters);
  }
  return $adapters;
}