function tripal_get_lightest_views_integration_setup

2.x tripal_views.api.inc tripal_get_lightest_views_integration_setup($table_name)
3.x tripal_chado_views.api.inc tripal_get_lightest_views_integration_setup($table_name)

Retrieve the views integration setup_id 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

3 calls to tripal_get_lightest_views_integration_setup()
tripal_chado_views_get_lightest_priority_setup in tripal_chado_views/api/tripal_chado_views.DEPRECATED.inc
tripal_clone_views_integration in tripal_chado_views/api/tripal_chado_views.api.inc
Clone an integration. This is often a great way to create your own module-specific integration while still benifiting from an existing (or even the lightest priority) integration.
tripal_is_lightest_priority_setup in tripal_chado_views/api/tripal_chado_views.api.inc
Checks if you are dealing with the lightest priority setup for a given table. This is a good way to determine whether your modules integration is being used by views.
1 string reference to 'tripal_get_lightest_views_integration_setup'

File

tripal_chado_views/api/tripal_chado_views.api.inc, line 299
Provides API functions that support direct integration of Chado tables with Drupal Views.

Code

function tripal_get_lightest_views_integration_setup($table_name) {

  // D7 TODO: Check DBTNG changes work.
  $sql = "SELECT setup_id FROM {tripal_views} WHERE table_name=:table ORDER BY priority ASC";
  $setup = db_query($sql, array(':table' => $table_name));
  $setup = $setup->fetchObject();
  if ($setup) {
    return $setup->setup_id;
  }
  else {
    return FALSE;
  }
}