LimeSurvey API - Master branch

SurveyResponsesExport
in package
implements CommandInterface Uses AuthPermissionTrait

Table of Contents

Interfaces

CommandInterface

Properties

$exportSurvey  : ExportSurveyResultsService
Service responsible for exporting survey results.
$permission  : Permission
Permission helper used to check survey permissions.
$responseFactory  : ResponseFactory
Factory used to build API responses.
$survey  : Survey
Survey model service used to fetch survey records.
$surveyModel  : Survey|null
The loaded Survey instance for the current request.
$allowedFormats  : array<string|int, string>
Allowed export formats.
$permissionModel  : Permission|null

Methods

__construct()  : mixed
SurveyResponsesExport constructor.
process()  : array<string|int, mixed>
Process the export request and perform the export.
run()  : Response
setPermissionModel()  : void
getExportRequestData()  : array<string|int, mixed>
Read and validate export-related parameters from the request.
getPermissionModel()  : Permission
hasGlobalPermission()  : Response
hasSurveyPermission()  : Response
streamFile()  : never
Stream the exported file for download.

Properties

$allowedFormats

Allowed export formats.

private array<string|int, string> $allowedFormats = ['csv', 'html']

Methods

__construct()

SurveyResponsesExport constructor.

public __construct(Survey $survey, Permission $permission, ResponseFactory $responseFactory, ExportSurveyResultsService $exportSurvey) : mixed
Parameters
$survey : Survey

Survey model/service used to fetch surveys

$permission : Permission

Permission helper for checking access

$responseFactory : ResponseFactory

Factory to create API responses

$exportSurvey : ExportSurveyResultsService

Service responsible for exporting survey results

process()

Process the export request and perform the export.

public process(Request $request) : array<string|int, mixed>
Parameters
$request : Request
Tags
throws
PermissionDeniedException
throws
RuntimeException
throws
InvalidArgumentException
throws
Exception
Return values
array<string|int, mixed>

The export data with content/filePath and metadata

getExportRequestData()

Read and validate export-related parameters from the request.

protected getExportRequestData(Request $request) : array<string|int, mixed>
Parameters
$request : Request
Tags
throws
InvalidArgumentException
Return values
array<string|int, mixed>

[type, language]

hasGlobalPermission()

protected hasGlobalPermission(string $sPermission, string $sCRUD[, int|null $iUserID = null ]) : Response
Parameters
$sPermission : string
$sCRUD : string
$iUserID : int|null = null
Return values
Response

| boolean

hasSurveyPermission()

protected hasSurveyPermission(int $iSurveyID, string $sPermission, string $sCRUD[, string|null $iUserID = null ]) : Response
Parameters
$iSurveyID : int
$sPermission : string
$sCRUD : string
$iUserID : string|null = null
Return values
Response

| boolean

streamFile()

Stream the exported file for download.

protected streamFile(array<string|int, mixed> $exportData) : never
Parameters
$exportData : array<string|int, mixed>

Export data from the export service

Return values
never

        
On this page

Search results