You are here

function hook_webform_download_sids_query_alter in Webform 7.4

Alter the query that will produce the list of submission IDs to be downloaded.

Parameters

object $query: The query object that is being built up to provide the list of submission IDs.

See also

webform_download_sids_query()

Related topics

1 invocation of hook_webform_download_sids_query_alter()
webform_download_sids_query in includes/webform.report.inc
Given a set of range options, return an unexecuted select query.

File

./webform.api.php, line 854
Sample hooks demonstrating usage in Webform.

Code

function hook_webform_download_sids_query_alter(&$query) {
  global $user;

  // Check if component value matches a node ID and author of that node.
  $query
    ->join('webform_submitted_data', 'wsd', 'ws.sid = wsd.sid');
  $query
    ->condition('wsd.cid', 2);
  $query
    ->join('node', 'n', 'wsd.data = n.nid');
  $query
    ->condition('n.uid', $user->uid);
}