You are here

function _biblio_marc_type_map in Bibliography Module 6.2

Same name and namespace in other branches
  1. 7 modules/marcParse/biblio_marc.module \_biblio_marc_type_map()
  2. 7.2 modules/marcParse/biblio_marc.module \_biblio_marc_type_map()
1 call to _biblio_marc_type_map()
biblio_marc_biblio_import in modules/marcParse/biblio_marc.module

File

modules/marcParse/biblio_marc.module, line 174

Code

function _biblio_marc_type_map($type, $reverse = FALSE) {
  static $map = array();
  if (empty($map)) {
    $map = unserialize(db_result(db_query("SELECT type_map FROM {biblio_type_maps} WHERE format='marc'")));
  }
  if ($reverse) {
    return ($tag = array_search($type, $map)) ? $tag : 'Generic';

    //return the biblio type or 129 (Misc) if type not found
  }
  return isset($map[$type]) ? $map[$type] : 129;

  //return the biblio type or 129 (Misc) if type not found
}