‪TYPO3CMS  ‪main
TYPO3\CMS\Frontend\DataProcessing\DatabaseQueryProcessor Class Reference
Inheritance diagram for TYPO3\CMS\Frontend\DataProcessing\DatabaseQueryProcessor:
TYPO3\CMS\Frontend\ContentObject\DataProcessorInterface

Public Member Functions

 __construct (protected readonly ContentDataProcessor $contentDataProcessor)
 
array process (ContentObjectRenderer $cObj, array $contentObjectConfiguration, array $processorConfiguration, array $processedData)
 

Detailed Description

Fetch records from the database, using the default .select syntax from TypoScript.

This way, e.g. a FLUIDTEMPLATE cObject can iterate over the array of records.

Example TypoScript configuration:

10 = TYPO3\CMS\Frontend\DataProcessing\DatabaseQueryProcessor 10 { table = tt_address pidInList = 123 where = company="Acme" AND first_name="Ralph" orderBy = sorting DESC as = addresses dataProcessing { 10 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor 10 { references.fieldName = image } } }

where "as" means the variable to be containing the result-set from the DB query.

Definition at line 47 of file DatabaseQueryProcessor.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Frontend\DataProcessing\DatabaseQueryProcessor::__construct ( protected readonly ContentDataProcessor  $contentDataProcessor)

Definition at line 49 of file DatabaseQueryProcessor.php.

Member Function Documentation

◆ process()

array TYPO3\CMS\Frontend\DataProcessing\DatabaseQueryProcessor::process ( ContentObjectRenderer  $cObj,
array  $contentObjectConfiguration,
array  $processorConfiguration,
array  $processedData 
)

Fetches records from the database as an array

Parameters
ContentObjectRenderer$cObj‪The data of the content element or page
array$contentObjectConfiguration‪The configuration of Content Object
array$processorConfiguration‪The configuration of this processor
array$processedData‪Key/value store of processed data (e.g. to be passed to a Fluid View)
Returns
‪array the processed data as key/value store

Implements TYPO3\CMS\Frontend\ContentObject\DataProcessorInterface.

Definition at line 61 of file DatabaseQueryProcessor.php.

References TYPO3\CMS\Webhooks\Message\$record, TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\checkIf(), TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\getRecords(), TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\getRequest(), and TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrapValue().