function chado_get_custom_table_names

2.x tripal_core.custom_tables.api.inc chado_get_custom_table_names($include_mview = TRUE)

Retrieves the list of custom tables in this site.

@returns An associative array where the key and value pairs are the table names.

Related topics

File

tripal_core/api/tripal_core.custom_tables.api.inc, line 296
Provides an API to manage custom tables in Chado.

Code

function chado_get_custom_table_names($include_mview = TRUE) {

  $sql = "SELECT table_name FROM {tripal_custom_tables}";
  if (!$include_mview) {
    $sql .= " WHERE mview_id IS NULL";
  }
  $resource = db_query($sql);

  foreach ($resource as $r) {
    $tables[$r->table_name] = $r->table_name;
  }

  asort($tables);
  return $tables;
}