function chado_get_custom_table_schema

2.x tripal_core.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_core/api/tripal_core.chado_schema.api.inc
Retrieves the chado tables Schema API array.
tripal_get_chado_custom_schema in tripal_core/api/tripal_core.DEPRECATED.api.inc
1 string reference to 'chado_get_custom_table_schema'

File

tripal_core/api/tripal_core.chado_schema.api.inc, line 509

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);
  }
}