function tripal_pub_AGL_count
2.x tripal_pub.AGL.inc | tripal_pub_AGL_count($yazc, $search_str) |
3.x tripal_chado.pub_importer_AGL.inc | tripal_pub_AGL_count( |
1.x AGL.inc | tripal_pub_AGL_count($search_array) |
Retreives the total number of publications that match the search string.
Parameters
$yazc: The YAZC connection object.
$search_str: The search string to use for searching.
Return value
a count of the total number of publications that match the search string
Related topics
1 call to tripal_pub_AGL_count()
- tripal_pub_remote_search_AGL in tripal_pub/
includes/ importers/ tripal_pub.AGL.inc - A hook for performing the search on the AGL database.
File
- tripal_pub/
includes/ importers/ tripal_pub.AGL.inc, line 501 - Importer for the USDA Agricultural Library (Agricola).
Code
function tripal_pub_AGL_count($yazc, $search_str) {
// Sort by publication date descending.
// yaz_sort($yazc, "1=31 id");
if (!yaz_search($yazc, "rpn", $search_str)) {
$error_no = yaz_errno($yazc);
$error_msg = yaz_error($yazc);
$additional = yaz_addinfo($yazc);
if ($additional != $error_msg) {
$error_msg .= " $additional";
}
drupal_set_message("ERROR preparing search at AGL: ($error_no) $error_msg", "error");
watchdog('tpub_import', "ERROR preparing search at AGL: (%error_no) %error_msg",
array('%error_no' => $error_no, '%error_msg' => $error_msg), WATCHDOG_ERROR);
return 0;
}
if (!yaz_wait()) {
$error_no = yaz_errno($yazc);
$error_msg = yaz_error($yazc);
$additional = yaz_addinfo($yazc);
if ($additional != $error_msg) {
$error_msg .= " $additional";
}
drupal_set_message("ERROR waiting on search at AGL: ($error_no) $error_msg", "error");
watchdog('tpub_import', "ERROR waiting on search at AGL: (%error_no) %error_msg",
array('%error_no' => $error_no, '%error_msg' => $error_msg), WATCHDOG_ERROR);
return 0;
}
// get the total number of results from the serach
$count = yaz_hits($yazc);
return $count;
}