LimeSurvey API - Master branch

HtmlExportWriter
in package
implements ExportWriterInterface Uses ExportHeadingTrait

Table of Contents

Interfaces

ExportWriterInterface

Properties

$filename  : string
$filePath  : string|null
$handle  : resource|null
$metaColumns  : array<string|int, mixed>
$metadata  : array<string|int, mixed>
$responseCount  : int

Methods

export()  : array<string|int, mixed>
Export survey responses to HTML format.
finalize()  : array<string|int, mixed>
Finalize the export and return the result.
getFileExtension()  : string
Get the file extension for HTML format.
getMimeType()  : string
Get the MIME type for HTML format.
init()  : void
Initialize the writer for chunked export.
writeChunk()  : void
Write a chunk of responses.
buildQuestionHeading()  : string
Build a question heading matching the legacy export "full" heading format.
cleanHeadingText()  : string
Strip HTML tags and decode entities from text.

Properties

$filePath

private string|null $filePath = null

File path for file output mode

$handle

private resource|null $handle = null

File handle for chunked writing

$metaColumns

private array<string|int, mixed> $metaColumns = []

Active metadata columns from fieldMap

$metadata

private array<string|int, mixed> $metadata = []

Metadata from init

Methods

export()

Export survey responses to HTML format.

public export(array<string|int, mixed> $responses, array<string|int, mixed> $surveyQuestions, array<string|int, mixed> $metadata) : array<string|int, mixed>
Parameters
$responses : array<string|int, mixed>

The survey responses data

$surveyQuestions : array<string|int, mixed>

The survey questions field map

$metadata : array<string|int, mixed>

Additional metadata (survey ID, language, outputMode, etc.)

Tags
SuppressWarnings

(PHPMD.ExcessiveMethodLength)

Return values
array<string|int, mixed>

Export result with content/filePath and metadata

finalize()

Finalize the export and return the result.

public finalize() : array<string|int, mixed>
Return values
array<string|int, mixed>

Export result with content/filePath and metadata

getFileExtension()

Get the file extension for HTML format.

public getFileExtension() : string
Return values
string

getMimeType()

Get the MIME type for HTML format.

public getMimeType() : string
Return values
string

init()

Initialize the writer for chunked export.

public init(array<string|int, mixed> $surveyQuestions, array<string|int, mixed> $metadata) : void
Parameters
$surveyQuestions : array<string|int, mixed>

The survey questions field map (for headers)

$metadata : array<string|int, mixed>

Additional metadata (surveyId, language, etc.)

Tags
SuppressWarnings

(PHPMD.ExcessiveMethodLength)

writeChunk()

Write a chunk of responses.

public writeChunk(array<string|int, mixed> $responses, array<string|int, mixed> $surveyQuestions) : void
Parameters
$responses : array<string|int, mixed>

Chunk of survey responses data

$surveyQuestions : array<string|int, mixed>

The survey questions field map

buildQuestionHeading()

Build a question heading matching the legacy export "full" heading format.

private buildQuestionHeading(array<string|int, mixed> $question) : string
Parameters
$question : array<string|int, mixed>

Question field map entry

Return values
string

cleanHeadingText()

Strip HTML tags and decode entities from text.

private cleanHeadingText(string $text) : string
Parameters
$text : string
Return values
string

        
On this page

Search results