function chado_node_get_base_table

2.x tripal_core.chado_nodes.api.inc chado_node_get_base_table($content_type, $module = FALSE)

Determine the chado base table for a given content type

Parameters

$content_type: The machine name of the content type (node type) you want to determine the base chado table of

$module: (Optional) The machine-name of the module implementing the content type

Return value

The name of the chado base table for the specified content type

Related topics

2 calls to chado_node_get_base_table()
chado_node_get_title_format in tripal_core/api/tripal_core.chado_nodes.title_and_path.api.inc
Get the title format for a specific content type
chado_node_get_url_format in tripal_core/api/tripal_core.chado_nodes.title_and_path.api.inc
Get the url format for a specific content type

File

tripal_core/api/tripal_core.chado_nodes.api.inc, line 111
API to handle much of the common functionality implemented when creating a drupal node type.

Code

function chado_node_get_base_table($content_type, $module = FALSE) {

  if ($module) {
    $node_info = call_user_func($details['module'] . '_node_info');
  }
  else {
    $node_types = module_invoke_all('node_info');

    if (isset($node_types[$content_type])) {
      $node_info = $node_types[$content_type];
    }
    else {
      return FALSE;
    }
  }

  if (isset($node_info['chado_node_api']['base_table'])) {
    return $node_info['chado_node_api']['base_table'];
  }
  else {
    return FALSE;
  }

}