You are here

function node_import_save_task in Node import 6

Create a new import task.

Parameters

$values: Array of filled in values.

Return value

Integer. Unique identifier for the task or FALSE if the task could not be saved to the database.

Related topics

1 call to node_import_save_task()
node_import_add_form_submit_next in ./node_import.admin.inc

File

./node_import.inc, line 1069
Public API of the Node import module.

Code

function node_import_save_task($values) {
  global $user;
  if (!isset($values['uid'])) {
    $values['uid'] = $user->uid;
  }
  if (!isset($values['created'])) {
    $values['created'] = time();
  }
  if (!isset($values['changed'])) {
    $values['changed'] = time();
  }
  if (drupal_write_record('node_import_tasks', $values) === SAVED_NEW) {
    module_invoke_all('node_import_task', $values, 'insert');
    return $values['taskid'];
  }
  return FALSE;
}