You are here

function hosting_task_insert in Hosting 6.2

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

Implementation of hook_insert().

1 call to hosting_task_insert()
hosting_task_update in task/hosting_task.module
Implementation of hook_update().

File

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

Code

function hosting_task_insert($node) {
  $node->executed = isset($node->executed) ? $node->executed : NULL;
  $node->delta = isset($node->delta) ? $node->delta : NULL;
  db_query("INSERT INTO {hosting_task} (vid, nid, task_type, task_status, rid, executed, delta) VALUES (%d, %d, '%s', %d, %d, %d, %d)", $node->vid, $node->nid, $node->task_type, $node->task_status, $node->rid, $node->executed, $node->delta);
  if (isset($node->task_args) && is_array($node->task_args)) {
    foreach ($node->task_args as $key => $value) {
      db_query("INSERT INTO {hosting_task_arguments} (vid, nid, name, value) VALUES (%d, %d, '%s', '%s')", $node->vid, $node->nid, $key, $value);
    }
  }
  hosting_task_set_title($node);
}