You are here

function webform_download_last_download_info in Webform 7.3

Same name and namespace in other branches
  1. 6.3 includes/webform.report.inc \webform_download_last_download_info()
  2. 7.4 includes/webform.report.inc \webform_download_last_download_info()

Get this user's last download information, including the SID and timestamp.

This function provides an array of information about the last download that a user had for a particular Webform node. Currently it only returns an array with two keys:

  • sid: The last submission ID that was downloaded.
  • requested: The timestamp of the last download request.

Parameters

$nid: The Webform NID.

$uid: The user account ID for which to retrieve download information.

Return value

An array of download information or FALSE if this user has never downloaded results for this particular node.

2 calls to webform_download_last_download_info()
webform_download_sids in includes/webform.report.inc
Given a set of range options, retrieve a set of SIDs for a webform node.
webform_results_download_range_after_build in includes/webform.report.inc
FormAPI after build function for the download range fieldset.

File

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

Code

function webform_download_last_download_info($nid, $uid = NULL) {
  $uid = isset($uid) ? $uid : $GLOBALS['user']->uid;
  $info = db_select('webform_last_download', 'wld')
    ->fields('wld')
    ->condition('nid', $nid)
    ->condition('uid', $uid)
    ->execute()
    ->fetchAssoc();
  return $info;
}