function tripal_views_get_table_lightest_priority

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

Retrieve the priority of 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

returns the lowest priority. If the table has not been integrated, a priority of 10 is returned.

Related topics

1 call to tripal_views_get_table_lightest_priority()
tripal_views_add_field_to_integration in tripal_views/api/tripal_views.api.inc
Adds the given field to an existing or cloned integration. In the case of a cloned integration, the lightest integration is used as the template for the clone.

File

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

Code

function tripal_views_get_table_lightest_priority($table_name) {

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