You are here

function webform_results_download_rows in Webform 7.4

Returns rows of downloadable webform data.

Parameters

$node: The webform node on which to generate the analysis.

array $options: A list of options that define the output format. These are generally passed through from the GUI interface.

int $serial_start: The starting position for the Serial column in the output.

$last_sid: If set to a non-NULL value, the last sid will be returned.

Return value

array An array of rows built according to the provided $serial_start and $pager_count variables. Note that the current page number is determined by the super-global $_GET['page'] variable.

Deprecated

in webform:7.x-4.8 and is removed from webform:7.x-5.0. See webform_results_download_rows_process().

See also

https://www.drupal.org/project/webform/issues/2465291

1 call to webform_results_download_rows()
webform_results_export in includes/webform.report.inc
Generate a Excel-readable CSV file containing all submissions for a Webform.

File

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

Code

function webform_results_download_rows($node, array $options, $serial_start = 0, &$last_sid = NULL) {

  // Get all the required submissions for the download.
  $filters['nid'] = $node->nid;
  if (isset($options['sids'])) {
    $filters['sid'] = $options['sids'];
  }
  elseif (!empty($options['completion_type']) && $options['completion_type'] !== 'all') {
    $filters['is_draft'] = (int) ($options['completion_type'] === 'draft');
  }
  $submissions = webform_get_submissions($filters, NULL);
  if (isset($last_sid)) {
    $last_sid = end($submissions) ? key($submissions) : NULL;
  }
  return webform_results_download_rows_process($node, $options, $serial_start, $submissions);
}