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

Public Member Functions

 __construct ()
 
array process (ContentObjectRenderer $cObj, array $contentObjectConfiguration, array $processorConfiguration, array $processedData)
 

Protected Attributes

ContentDataProcessor $contentDataProcessor
 

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 46 of file DatabaseQueryProcessor.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Frontend\DataProcessing\DatabaseQueryProcessor::__construct ( )

Constructor

Definition at line 55 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 70 of file DatabaseQueryProcessor.php.

References TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\checkIf(), TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\getRecords(), and TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrapValue().

Member Data Documentation

◆ $contentDataProcessor

ContentDataProcessor TYPO3\CMS\Frontend\DataProcessing\DatabaseQueryProcessor::$contentDataProcessor
protected

Definition at line 50 of file DatabaseQueryProcessor.php.