You are here

function hosting_get_most_recent_task in Hostmaster (Aegir) 6

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

This is used for documenting issues with verification.

2 calls to hosting_get_most_recent_task()
drush_hosting_task_validate in modules/hosting/task.hosting.inc
Validate hook for the hosting-task Drush command.
hosting_add_task in modules/hosting/task/hosting_task.module
Helper function to generate new task node

File

modules/hosting/task/hosting_task.module, line 819
Web server node type is defined here.

Code

function hosting_get_most_recent_task($rid, $type) {
  $nid = db_result(db_query("SELECT t.nid FROM {hosting_task} t INNER JOIN {node} n ON n.vid = t.vid WHERE task_type='%s' and t.rid=%d ORDER BY t.vid DESC limit 1", $type, $rid));
  if ($nid) {
    return node_load($nid);
  }
  return false;
}