function tripal_views_get_lightest_priority_setup

2.x tripal_views.DEPRECATED.inc tripal_views_get_lightest_priority_setup($table_name)
1.x tripal_views.api.inc tripal_views_get_lightest_priority_setup($table_name)

Retrieve the views integration setup with the lightest priority for a given table

NOTE: Uses lightest priority (drupal-style) where the range is from -10 to 10 and -10 is of highest priority.

Parameters

$table_name: The name of the table to retrieve the setup ID for. This can be either a materialized view or a chado table

Return value

On success, the setup_id to use for integration of this table; otherwise FALSE

Related topics

2 calls to tripal_views_get_lightest_priority_setup()
tripal_views_clone_integration in tripal_views/api/tripal_views.api.inc
Clone an integration
tripal_views_is_lightest_priority_setup in tripal_views/api/tripal_views.api.inc
Checks if you are dealing with the lightest priority setup for a given table

File

tripal_views/api/tripal_views.api.inc, line 55
API functions for Tripal Views Integration

Code

function tripal_views_get_lightest_priority_setup($table_name) {

  $sql = "SELECT setup_id FROM {tripal_views} WHERE table_name='%s' ORDER BY priority ASC";
  $setup = db_fetch_object(db_query($sql, $table_name));
  if ($setup) {
    return $setup->setup_id;
  }
  else {
    return FALSE;
  }
}