You are here

function taxonomy_xml_relationship_synonyms_reverse in Taxonomy import/export via XML 7

Invert the synonyms array

1 call to taxonomy_xml_relationship_synonyms_reverse()
taxonomy_xml_relationship_synonyms_for in ./taxonomy_xml.module
Reverse-lookup of the synonyms table. Returns an array of synonyms for the given cannonc predicate

File

./taxonomy_xml.module, line 1267
Make it possible to import and export taxonomies as XML documents.

Code

function taxonomy_xml_relationship_synonyms_reverse() {
  static $flipped;
  if ($flipped) {
    return $flipped;
  }
  $arr = taxonomy_xml_relationship_synonyms();
  foreach ($arr as $syn => $canonic) {
    if (!isset($flipped[$canonic])) {
      $flipped[$canonic] = array();
    }
    $flipped[$canonic][] = $syn;
  }
  return $flipped;
}