CreateRecordReaction implements ReactionInterface

A reaction that creates a database record based on the payload within a request.

Internal

This is a specific reaction implementation and is not considered part of the Public TYPO3 API.

Table of Contents

Interfaces

ReactionInterface

Constants

PLACEHOLDER_PATTERN  : string = '/\$\{([^\}]*)\}/'
A placeholder of the field map, "${path.in.payload}", with the path as its only group.

Methods

__construct()  : mixed
getDescription()  : string
A meaningful description for the reaction
getIconIdentifier()  : string
An icon identifier for the reaction
getType()  : string
The reaction type, used for the registry and stored in the database
react()  : ResponseInterface
Main method of the reaction, handling the incoming request
replacePlaceHolders()  : string|null
Returns null where a placeholder cannot be resolved. The field is then left out of the datamap entirely, so the default of the table applies, rather than the record being written with a literal "${...}" in it.
resolve()  : CreateRecordResolution
Composes the record react() writes for this payload, without writing it.
buildResponseFromDataHandler()  : ResponseInterface
jsonResponse()  : ResponseInterface

Constants

PLACEHOLDER_PATTERN

A placeholder of the field map, "${path.in.payload}", with the path as its only group.

public string PLACEHOLDER_PATTERN = '/\$\{([^\}]*)\}/'

Methods

getDescription()

A meaningful description for the reaction

public static getDescription() : string
Return values
string

getIconIdentifier()

An icon identifier for the reaction

public static getIconIdentifier() : string
Return values
string

getType()

The reaction type, used for the registry and stored in the database

public static getType() : string
Return values
string

react()

Main method of the reaction, handling the incoming request

public react(ServerRequestInterface $request, array<string|int, mixed> $payload, ReactionInstruction $reaction) : ResponseInterface
Parameters
$request : ServerRequestInterface
$payload : array<string|int, mixed>
$reaction : ReactionInstruction
Return values
ResponseInterface

replacePlaceHolders()

Returns null where a placeholder cannot be resolved. The field is then left out of the datamap entirely, so the default of the table applies, rather than the record being written with a literal "${...}" in it.

public replacePlaceHolders(mixed $value, array<string|int, mixed> $payload) : string|null
Parameters
$value : mixed
$payload : array<string|int, mixed>
Internal

only public due to tests

Return values
string|null

resolve()

Composes the record react() writes for this payload, without writing it.

public resolve(array<string|int, mixed> $payload, ReactionInstruction $reaction, BackendUserAuthentication $user) : CreateRecordResolution

The field permissions are checked for the user handed in. Item processors of a field still read $GLOBALS['BE_USER'], so a caller resolving as a user other than the global one has to set it up there as well. What DataHandler would still reject is not known here.

Parameters
$payload : array<string|int, mixed>
$reaction : ReactionInstruction
$user : BackendUserAuthentication
Internal

only public for the dry run of the backend module

Return values
CreateRecordResolution

buildResponseFromDataHandler()

protected buildResponseFromDataHandler(DataHandler $dataHandler[, int $successCode = 200 ][, array<string|int, mixed> $skippedFields = [] ]) : ResponseInterface
Parameters
$dataHandler : DataHandler
$successCode : int = 200
$skippedFields : array<string|int, mixed> = []
Return values
ResponseInterface

jsonResponse()

protected jsonResponse(array<string|int, mixed> $data[, int $statusCode = 200 ]) : ResponseInterface
Parameters
$data : array<string|int, mixed>
$statusCode : int = 200
Return values
ResponseInterface
On this page

Search results