function pardot_submission_save in Pardot Integration 6
Same name and namespace in other branches
- 7 pardot.module \pardot_submission_save()
Helper function that save form submissions.
Parameters
object $submission: A submission object.
2 calls to pardot_submission_save()
- pardot_footer in ./
pardot.module - Implementation of hook_footer().
- pardot_webform_submit in ./
pardot.module - Submit handler added to webforms to store submissions for pardot.
File
- ./
pardot.module, line 345 - ParDot integration module.
Code
function pardot_submission_save($submission) {
// Set some sane defaults for new submissions.
if (!isset($submission->submitted)) {
$submission->submitted = $_SERVER['REQUEST_TIME'];
}
if (!isset($submission->status)) {
$submission->status = PARDOT_STATUS_NEW;
}
if (isset($submission->sid)) {
drupal_write_record('pardot_submissions', $submission, array(
'sid',
));
}
else {
drupal_write_record('pardot_submissions', $submission);
}
}