You are here

function msnf_step_save in Multistep Nodeform 7

Saves a single step definition.

Parameters

<object> $step: The step definition to save.

1 string reference to 'msnf_step_save'
msnf_schema in ./msnf.install
Implements hook_schema().

File

./msnf.module, line 854
Main functions for module "Multistep Nodeform".

Code

function msnf_step_save(&$step) {

  // Prepare the record.
  $object = msnf_pack($step);
  if (isset($object->export_type) && $object->export_type & EXPORT_IN_DATABASE) {

    // Existing record.
    $update = array(
      'id',
    );
    module_invoke_all('msnf_update_step', $object);
  }
  else {

    // New record.
    $update = array();
    $object->export_type = EXPORT_IN_DATABASE;
    module_invoke_all('msnf_create_step', $object);
  }

  // Write the record.
  return drupal_write_record('msnf_step', $object, $update);
}