function chado_get_custom_table_schema

2.x tripal_core.chado_schema.api.inc chado_get_custom_table_schema($table)
3.x tripal_chado.schema.api.inc chado_get_custom_table_schema($table)

Retrieves the schema in an array for the specified custom table.

Parameters

$table: The name of the table to create.

Return value

A Drupal-style Schema API array definition of the table. Returns FALSE on failure.

Related topics

2 calls to chado_get_custom_table_schema()
chado_get_schema in tripal_chado/api/tripal_chado.schema.api.inc
Retrieves the chado tables Schema API array.
tripal_get_chado_custom_schema in legacy/tripal_core/api/tripal_core.DEPRECATED.inc
1 string reference to 'chado_get_custom_table_schema'

File

tripal_chado/api/tripal_chado.schema.api.inc, line 559
Provides an application programming interface (API) for describing Chado tables.

Code

function chado_get_custom_table_schema($table) {

  $sql = "SELECT schema FROM {tripal_custom_tables} WHERE table_name = :table_name";
  $results = db_query($sql, array(':table_name' => $table));
  $custom = $results->fetchObject();
  if (!$custom) {
    return FALSE;
  }
  else {
    return unserialize($custom->schema);
  }
}