function chado_refresh_mview

3.x tripal_chado.mviews.api.inc chado_refresh_mview($mview_id)

Populates the specified Materialized View.

Parameters

$mview_id: The unique ID of the materialized view for the action to be performed on.

Related topics

2 calls to chado_refresh_mview()
tripal_mviews_add_populate_job in tripal_chado/includes/tripal_chado.mviews.inc
A wrapper for the chado_refresh_mview() API function, which then redirects back to the admin page for mviews.
tripal_refresh_mview in tripal_chado/api/tripal_chado.DEPRECATED.api.inc
Populates the specified Materialized View.

File

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

Code

function chado_refresh_mview($mview_id) {
  global $user;

  if (!$mview_id) {
    return '';
  }

  // Get this mview details.
  $sql = "SELECT * FROM {tripal_mviews} WHERE mview_id = :mview_id";
  $results = db_query($sql, array(':mview_id' => $mview_id));
  $mview = $results->fetchObject();

  // Add a job to populate the mview.
  $args = array("$mview_id");
  tripal_add_job("Populate materialized view '$mview->name'", 'tripal_chado', 
  'chado_populate_mview', $args, $user->uid);

}