OpHandlerResponsesFileDelete
in package
implements
OpHandlerInterface
Uses
OpHandlerValidationTrait
Table of Contents
Interfaces
Properties
Methods
- __construct() : mixed
- addErrorToValidationData() : array<string|int, mixed>
- Adds the error message to the validationData array
- canHandle() : bool
- Checks if the operation is applicable for the given entity.
- getValidationReturn() : array<string|int, mixed>|array<string|int, array<string|int, ValidationErrorItem>>
- handle() : void
- Expects a patch structure like this: { "entity": "response-file", "op": "delete", "id": 90 }
- 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
Properties
$surveyResponseService
protected
SurveyResponseService
$surveyResponseService
Methods
__construct()
public
__construct(SurveyResponseService $surveyResponseService) : mixed
Parameters
- $surveyResponseService : SurveyResponseService
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>canHandle()
Checks if the operation is applicable for the given entity.
public
canHandle(OpInterface $op) : bool
Parameters
- $op : OpInterface
Return values
boolgetValidationReturn()
public
getValidationReturn(string $error, array<string|int, mixed> $validationData, OpInterface $op) : array<string|int, mixed>|array<string|int, array<string|int, ValidationErrorItem>>
Parameters
- $error : string
- $validationData : array<string|int, mixed>
- $op : OpInterface
Return values
array<string|int, mixed>|array<string|int, array<string|int, ValidationErrorItem>>handle()
Expects a patch structure like this: { "entity": "response-file", "op": "delete", "id": 90 }
public
handle(OpInterface $op) : void
Parameters
- $op : OpInterface
Tags
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>validateOperation()
Checks if patch is valid for this operation.
public
validateOperation(OpInterface $op) : array<string|int, mixed>
Parameters
- $op : OpInterface
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>