LimeSurvey API - Master branch

OpHandlerImport
in package
implements OpHandlerInterface Uses OpHandlerExceptionTrait, OpHandlerSurveyTrait, OpHandlerValidationTrait

Table of Contents

Interfaces

OpHandlerInterface

Properties

$entity  : string
$surveyActivate  : SurveyActivate

Methods

__construct()  : mixed
Constructor
addErrorToValidationData()  : array<string|int, mixed>
Adds the error message to the validationData array
canHandle()  : bool
Determines whether the request can be handled
extractTempId()  : int|mixed
returns and removes tempId from dataset
getSurveyIdFromContext()  : int
Extracts and returns surveyId from context
getValidationReturn()  : array<string|int, mixed>|array<string|int, array<string|int, ValidationErrorItem>>
handle()  : void
"patch": [{ "entity": "importResponses", "op": "update", "id": 809, "props": { "timestamp": 20250303173908, "preserveIDs": true } } ]
validateCollection()  : array<string|int, mixed>
checks incoming props if it's a collection otherwise adds error to validationData.
validateCollectionIndex()  : array<string|int, mixed>
validates for collection first and then checks the indexes to be numeric or alphabetic dependent on the alphabetic flag
validateEntityId()  : array<string|int, mixed>
checks for entity id being there, otherwise adds error to validationData
validateOperation()  : array<string|int, mixed>
Checks if patch is valid for this operation.
validateSurveyIdFromContext()  : array<string|int, mixed>
checks for survey ID being there, otherwise adds error to validationData
throwNoValuesException()  : never

Properties

Methods

addErrorToValidationData()

Adds the error message to the validationData array

public addErrorToValidationData(string $error, array<string|int, mixed> $validationData) : array<string|int, mixed>
Parameters
$error : string
$validationData : array<string|int, mixed>
Return values
array<string|int, mixed>

extractTempId()

returns and removes tempId from dataset

public extractTempId(array<string|int, mixed> &$dataSet) : int|mixed
Parameters
$dataSet : array<string|int, mixed>
Return values
int|mixed

handle()

"patch": [{ "entity": "importResponses", "op": "update", "id": 809, "props": { "timestamp": 20250303173908, "preserveIDs": true } } ]

public handle(OpInterface $op) : void
Parameters
$op : OpInterface

validateCollection()

checks incoming props if it's a collection otherwise adds error to validationData.

public validateCollection(OpInterface $op, array<string|int, mixed> $validationData) : array<string|int, mixed>

Basically this only check for the incoming props being a multidimensional array.

Parameters
$op : OpInterface
$validationData : array<string|int, mixed>
Return values
array<string|int, mixed>

validateCollectionIndex()

validates for collection first and then checks the indexes to be numeric or alphabetic dependent on the alphabetic flag

public validateCollectionIndex(OpInterface $op, array<string|int, mixed> $validationData[, bool $alphabetic = true ]) : array<string|int, mixed>
Parameters
$op : OpInterface
$validationData : array<string|int, mixed>
$alphabetic : bool = true
Return values
array<string|int, mixed>

validateEntityId()

checks for entity id being there, otherwise adds error to validationData

public validateEntityId(OpInterface $op, array<string|int, mixed> $validationData) : array<string|int, mixed>
Parameters
$op : OpInterface
$validationData : array<string|int, mixed>
Return values
array<string|int, mixed>

validateSurveyIdFromContext()

checks for survey ID being there, otherwise adds error to validationData

public validateSurveyIdFromContext(OpInterface $op, array<string|int, mixed> $validationData) : array<string|int, mixed>
Parameters
$op : OpInterface
$validationData : array<string|int, mixed>
Return values
array<string|int, mixed>

        
On this page

Search results