LimeSurvey API - Master branch

StatisticsService
in package

Service layer for survey statistics.

Acts as the entry point for generating statistics across all configured graph processors (e.g., question-level statistics).

Table of Contents

Properties

$charts  : array<string|int, mixed>
$filters  : StatisticsResponseFilters
$language  : string
$output  : array<string|int, mixed>
$surveyId  : int|string

Methods

__construct()  : mixed
run()  : array<string|int, mixed>
Execute statistics generation for all configured graphs.
setChart()  : $this
Register a chart type processor by class name.
setFilters()  : void
Set response filters to apply to all chart processors.
setSurvey()  : $this
Set survey context (ID + language).
handleChartOutput()  : void

Properties

$charts

private array<string|int, mixed> $charts

List of charts classes to run

$output

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

Gathered chart results

Methods

run()

Execute statistics generation for all configured graphs.

public run([array<string|int, mixed> $specificCharts = [] ]) : array<string|int, mixed>
Parameters
$specificCharts : array<string|int, mixed> = []

List of specific chart classes to run

Tags
throws
RuntimeException
Return values
array<string|int, mixed>

Combined output from all graph processors

setChart()

Register a chart type processor by class name.

public setChart(string $chart) : $this
Parameters
$chart : string
Return values
$this

setSurvey()

Set survey context (ID + language).

public setSurvey(int|string $surveyId[, string|null $language = null ]) : $this
Parameters
$surveyId : int|string

Survey ID

$language : string|null = null

Language code (default = null)

Tags
throws
InvalidArgumentException
throws
NotFoundException
Return values
$this

handleChartOutput()

private handleChartOutput(array<string|int, mixed> $data) : void
Parameters
$data : array<string|int, mixed>

        
On this page

Search results