You are here

function certificate_snapshot_save in Certificate 6.2

Same name and namespace in other branches
  1. 8.3 certificate.module \certificate_snapshot_save()
  2. 6 certificate.module \certificate_snapshot_save()
  3. 7.3 certificate.module \certificate_snapshot_save()
  4. 7.2 certificate.module \certificate_snapshot_save()
  5. 3.x certificate.module \certificate_snapshot_save()

Inserts a new snapshot, or updates an existing one.

Parameters

$certificate: A certificate to be saved. If $certificate['cid'] is set, the certificate will be updated. Otherwise, a new certificate will be inserted into the database.

Return value

The saved certificate, with its ID set.

See also

certificate_single()

1 call to certificate_snapshot_save()
certificate_single in ./certificate.pages.inc
Generate a single certificate.

File

./certificate.module, line 464
Certificate module.

Code

function certificate_snapshot_save($snapshot) {
  if (isset($snapshot['csid'])) {
    drupal_write_record('certificate_snapshots', $snapshot, 'csid');
  }
  else {
    drupal_write_record('certificate_snapshots', $snapshot);
  }
  return $snapshot;
}