function chado_pager_get_count

2.x tripal_core.chado_query.api.inc chado_pager_get_count($element)
3.x tripal_chado.query.api.inc chado_pager_get_count($element)

A function to retrieve the total number of records for a pager that was generated using the chado_pager_query() function

Parameters

$element: The $element argument that was passed to the chado_pager_query function

Related topics

File

tripal_core/api/tripal_core.chado_query.api.inc, line 1667
Provides an API for querying of chado including inserting, updating, deleting and selecting from chado.

Code

function chado_pager_get_count($element) {
  $q = $_GET['q'];

  if (array_key_exists($q, $GLOBALS['chado_pager']) and 
    array_key_exists($element, $GLOBALS['chado_pager'][$q])) {
    return $GLOBALS['chado_pager'][$q][$element]['total_records'];
  }
  else {
    return 0;
  }
}