function tripal_get_mview_id

2.x tripal_core.mviews.api.inc tripal_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

4 calls to tripal_get_mview_id()
1 string reference to 'tripal_get_mview_id'

File

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

Code

function tripal_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;
}