You are here

function _potx_schema_reverse_lookup in Translation template extractor 7.3

Same name and namespace in other branches
  1. 8 potx.local.inc \_potx_schema_reverse_lookup()

Find the module containing the schema for a specific config file, based on its matching candidates, using a reverse lookup table.

Parameters

array $matching_candidates: The list of matching candidates for a config file, ordered from specific to generic.

Return value

string|null The module containing the matching schema, if exists, otherwise NULL.

See also

_potx_find_matching_schema()

1 string reference to '_potx_schema_reverse_lookup'
potx_local_init in ./potx.local.inc
Initialize potx to run locally, e.g. by drush.

File

./potx.local.inc, line 149

Code

function _potx_schema_reverse_lookup($matching_candidates) {
  global $_potx_schema_lookup;
  global $_potx_reverse_lookup_built;
  if (!$_potx_reverse_lookup_built) {
    _potx_build_reverse_lookup();
  }
  foreach ($matching_candidates as $candidate) {
    if (isset($_potx_schema_lookup[$candidate])) {
      return $_potx_schema_lookup[$candidate];
    }
  }
  return NULL;
}