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

11 calls to chado_pager_get_count()

File

tripal_chado/api/tripal_chado.query.api.inc, line 1846
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;
  }
}