function tripal_mviews_get_mview_id

2.x tripal_core.DEPRECATED.api.inc tripal_mviews_get_mview_id($view_name)
3.x tripal_core.DEPRECATED.inc tripal_mviews_get_mview_id($view_name)
1.x tripal_core_mviews.api.inc tripal_mviews_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

3 calls to tripal_mviews_get_mview_id()

File

tripal_core/api/tripal_core_mviews.api.inc, line 272
Contains functions for the Materialized Views API

Code

function tripal_mviews_get_mview_id($view_name) {
  $sql = "SELECT * FROM {tripal_mviews} " .
    "WHERE name = '%s'";
  if (db_table_exists('tripal_mviews')) {
    $mview = db_fetch_object(db_query($sql, $view_name));
    if ($mview) {
      return $mview->mview_id;
    }
  }

  return FALSE;
}