function chado_get_mview_id

3.x tripal_chado.mviews.api.inc chado_get_mview_id($view_name)

Retrieve the materialized view_id given the name.

Parameters

$view_name: The name of the materialized view.

Return value

The unique identifier for the given view.

Related topics

6 calls to chado_get_mview_id()
OBOImporter::postRun in tripal_chado/includes/TripalImporter/OBOImporter.inc
tripal_chado_prepare_chado in tripal_chado/includes/setup/tripal_chado.setup.inc
Prepares Chado for use by Tripal.
tripal_chado_update_7323 in tripal_chado/tripal_chado.install
Adding the db2cv materialized view.
tripal_chado_update_7324 in tripal_chado/tripal_chado.install
Updating the db2cv materialized view.
tripal_extension_form_add_extensions in tripal/includes/tripal.extensions.inc
Adds each extension to the form.

... See full list

File

tripal_chado/api/tripal_chado.mviews.api.inc, line 219
Provides an application programming interface (API) to manage materialized views in Chado.

Code

function chado_get_mview_id($view_name) {
  if (db_table_exists('tripal_mviews')) {
    $sql = "SELECT * FROM {tripal_mviews} WHERE name = :name";
    $results = db_query($sql, array(':name' => $view_name));
    $mview = $results->fetchObject();
    if ($mview) {
      return $mview->mview_id;
    }
  }

  return FALSE;
}