You are here

function webform_update_webform_last_download in Webform 7.4

Insert or update a download record in table {webform_last_download}.

Parameters

object $node: The Webform node of the record to update.

int $uid: The user ID of the record to update.

int $sid: The last downloaded submission number.

int $requested: Timestamp of last download request.

Return value

int MergeQuery::STATUS_INSERT or ::STATUS_UPDATE.

3 calls to webform_update_webform_last_download()
WebformSubmissionTestCase::testWebformSubmissionDownload in tests/WebformSubmissionTestCase.test
Test that the correct submissions are offered for download.
WebformSubmissionTestCase::testWebformSubmissionFunctions in tests/WebformSubmissionTestCase.test
Test Webform submission utility functions.
webform_results_export_success in includes/webform.report.inc
Save the last-exported sid for new-only exports.

File

includes/webform.report.inc, line 1400
This file includes helper functions for creating reports for webform.module.

Code

function webform_update_webform_last_download(stdClass $node, $uid, $sid, $requested) {
  return db_merge('webform_last_download')
    ->key(array(
    'nid' => $node->nid,
    'uid' => $uid,
  ))
    ->fields(array(
    'sid' => $sid,
    'requested' => $requested,
  ))
    ->execute();
}