You are here

function linkit_profile_save in Linkit 7.2

Save a single Linkit profile.

1 call to linkit_profile_save()
linkit_profiles_reorder_submit in plugins/export_ui/linkit_profiles.inc
Save function for the reorder form.
1 string reference to 'linkit_profile_save'
linkit_schema in ./linkit.install
Implements hook_schema().

File

./linkit.module, line 888
Main file for linkit module.

Code

function linkit_profile_save($profile) {
  $schema = ctools_export_get_schema('linkit_profiles');
  $export = $schema['export'];

  // Objects should have a serial primary key. If not, simply fail to write.
  if (empty($export['primary key'])) {
    return FALSE;
  }
  $key = $export['primary key'];
  if ($profile->export_type & EXPORT_IN_DATABASE) {

    // Existing record.
    $update = array(
      $key,
    );
  }
  else {

    // New record.
    $update = array();
    $profile->export_type = EXPORT_IN_DATABASE;
  }
  return drupal_write_record('linkit_profiles', $profile, $update);
}