You are here

function hosting_get_most_recent_task in Hosting 7.3

Same name and namespace in other branches
  1. 5 task/hosting_task.module \hosting_get_most_recent_task()
  2. 6.2 task/hosting_task.module \hosting_get_most_recent_task()
  3. 7.4 task/hosting_task.module \hosting_get_most_recent_task()

Retrieve the latest task related to the specified platform, of a specific type.

This is used for documenting issues with verification.

File

task/hosting_task.module, line 1411
Web server node type is defined here.

Code

function hosting_get_most_recent_task($rid, $type) {
  $nid = db_query("SELECT t.nid FROM {hosting_task} t INNER JOIN {node} n ON n.vid = t.vid WHERE task_type = :task_type and t.rid = :t_rid ORDER BY t.vid DESC limit 1", array(
    ':task_type' => $type,
    ':t_rid' => $rid,
  ))
    ->fetchField();
  if ($nid) {
    return node_load($nid);
  }
  return FALSE;
}