‪TYPO3CMS  11.5
TYPO3\CMS\Lowlevel\Database\QueryGenerator Class Reference

Public Member Functions

 __construct (array $settings, array $menuItems, string $moduleName)
 
string form ()
 
string queryMaker ()
 
string search ()
 
 setFormName ($formName)
 

Protected Member Functions

string makeStoreControl ()
 
array initStoreArray ()
 
array cleanStoreQueryConfigs ($storeQueryConfigs, $storeArray)
 
 addToStoreQueryConfigs (array $storeQueryConfigs, int $index)
 
bool saveQueryInAction ($uid)
 
array loadStoreQueryConfigs ($storeQueryConfigs, $storeIndex, $writeArray)
 
string procesStoreControl ()
 
array getQueryResultCode ($type, array $dataRows, $table)
 
string csvValues ($row, $delim=',', $quote='"', $conf = [], $table = '')
 
string resultRowDisplay ($row, $conf, $table)
 
string getProcessedValueExtra ($table, $fieldName, $fieldValue, $conf, $splitString)
 
string getTreeList ($id, $depth, $begin=0, $permsClause='')
 
string makeValueList ($fieldName, $fieldValue, $conf, $table, $splitString)
 
string resultRowTitles ($row, $conf)
 
string makeFieldList ()
 
 init ($name, $table, $fieldList='', array $settings=[])
 
 setAndCleanUpExternalLists ($name, $list, $force='')
 
 procesData ($qC=[])
 
array cleanUpQueryConfig ($queryConfig)
 
array getFormElements ($subLevel=0, $queryConfig='', $parent='')
 
string makeComparisonSelector ($subscript, $fieldName, $conf)
 
string makeOptionList ($fieldName, $conf, $table)
 
string printCodeArray ($codeArr, $recursionLevel=0)
 
string mkOperatorSelect ($name, $op, $draw, $submit)
 
string mkTypeSelect ($name, $fieldName, $prepend='FIELD_')
 
string verifyType ($fieldName)
 
int verifyComparison ($comparison, $neg)
 
string mkFieldToInputSelect ($name, $fieldName)
 
string mkTableSelect ($name, $cur)
 
string mkCompSelect ($name, $comparison, $neg)
 
array getSubscript ($arr)
 
string getQuery ($queryConfig, $pad='')
 
array convertIso8601DatetimeStringToUnixTimestamp (array $conf)
 
bool isDateOfIso8601Format ($date)
 
string getQuerySingle ($conf, $first)
 
string int float null cleanInputVal ($conf, $suffix='')
 
string updateIcon ()
 
string getLabelCol ()
 
string makeSelectorTable ($modSettings, $enableList='table, fields, query, group, order, limit')
 
string getSelectQuery ($qString='')
 
string getDateTimePickerField ($name, $timestamp, $type)
 
 getBackendUserAuthentication ()
 
 getLanguageService ()
 

Protected Attributes

string $storeList = 'search_query_smallparts,search_result_labels,labels_noprefix,show_deleted,queryConfig,queryTable,queryFields,queryLimit,queryOrder,queryOrderDesc,queryOrder2,queryOrder2Desc,queryGroup,search_query_makeQuery'
 
int $noDownloadB = 0
 
array $hookArray = array( )
 
string $formName = ''
 
IconFactory $iconFactory
 
array $tableArray = array( )
 
array $settings = array( )
 
array $menuItems = array( )
 
string $moduleName
 
array $lang
 
array $compSQL
 
array $comp_offsets
 
string $name
 
string $table
 
string $fieldList
 
array $fields = array( )
 
array $extFieldLists = array( )
 
array $queryConfig = array( )
 
bool $enablePrefix = false
 
bool $enableQueryParts = false
 
string $fieldName
 
bool $showFieldAndTableNames = false
 

Private Member Functions

 renderNoResultsFoundMessage ()
 

Detailed Description

Class used in module tools/dbint (advanced search) and which may hold code specific for that module

This class is a specific implementation for the lowlevel extension and is not part of the TYPO3's Core API.

Definition at line 48 of file QueryGenerator.php.

Constructor & Destructor Documentation

◆ __construct()

Member Function Documentation

◆ addToStoreQueryConfigs()

TYPO3\CMS\Lowlevel\Database\QueryGenerator::addToStoreQueryConfigs ( array  $storeQueryConfigs,
int  $index 
)
protected

Add to store query configs

Definition at line 582 of file QueryGenerator.php.

Referenced by TYPO3\CMS\Lowlevel\Database\QueryGenerator\procesStoreControl().

◆ cleanInputVal()

string int float null TYPO3\CMS\Lowlevel\Database\QueryGenerator::cleanInputVal (   $conf,
  $suffix = '' 
)
protected

◆ cleanStoreQueryConfigs()

array TYPO3\CMS\Lowlevel\Database\QueryGenerator::cleanStoreQueryConfigs (   $storeQueryConfigs,
  $storeArray 
)
protected

Clean store query configs

Parameters
array$storeQueryConfigs
array$storeArray
Returns
‪array

Definition at line 567 of file QueryGenerator.php.

Referenced by TYPO3\CMS\Lowlevel\Database\QueryGenerator\procesStoreControl().

◆ cleanUpQueryConfig()

array TYPO3\CMS\Lowlevel\Database\QueryGenerator::cleanUpQueryConfig (   $queryConfig)
protected

◆ convertIso8601DatetimeStringToUnixTimestamp()

array TYPO3\CMS\Lowlevel\Database\QueryGenerator::convertIso8601DatetimeStringToUnixTimestamp ( array  $conf)
protected

Convert ISO-8601 timestamp (string) into unix timestamp (int)

Parameters
array$conf
Returns
‪array

Definition at line 2409 of file QueryGenerator.php.

References TYPO3\CMS\Lowlevel\Database\QueryGenerator\isDateOfIso8601Format().

Referenced by TYPO3\CMS\Lowlevel\Database\QueryGenerator\getQuery().

◆ csvValues()

string TYPO3\CMS\Lowlevel\Database\QueryGenerator::csvValues (   $row,
  $delim = ',',
  $quote = '"',
  $conf = [],
  $table = '' 
)
protected

CSV values

Parameters
array$row
string$delim
string$quote
array$conf
string$table
Returns
‪string A single line of CSV

Definition at line 861 of file QueryGenerator.php.

References TYPO3\CMS\Lowlevel\Database\QueryGenerator\$table, TYPO3\CMS\Core\Utility\CsvUtility\csvValues(), and TYPO3\CMS\Lowlevel\Database\QueryGenerator\getProcessedValueExtra().

Referenced by TYPO3\CMS\Lowlevel\Database\QueryGenerator\getQueryResultCode().

◆ form()

string TYPO3\CMS\Lowlevel\Database\QueryGenerator::form ( )

Get form

Returns
‪string

Definition at line 285 of file QueryGenerator.php.

◆ getBackendUserAuthentication()

◆ getDateTimePickerField()

string TYPO3\CMS\Lowlevel\Database\QueryGenerator::getDateTimePickerField (   $name,
  $timestamp,
  $type 
)
protected
Parameters
string$name‪the field name
string$timestamp‪ISO-8601 timestamp
string$type‪[datetime, date, time, timesec, year]
Returns
‪string

Definition at line 2812 of file QueryGenerator.php.

References $GLOBALS, TYPO3\CMS\Lowlevel\Database\QueryGenerator\$name, and TYPO3\CMS\Core\Utility\StringUtility\getUniqueId().

Referenced by TYPO3\CMS\Lowlevel\Database\QueryGenerator\getFormElements().

◆ getFormElements()

◆ getLabelCol()

string TYPO3\CMS\Lowlevel\Database\QueryGenerator::getLabelCol ( )
protected

Get label column

Returns
‪string

Definition at line 2544 of file QueryGenerator.php.

References $GLOBALS, and TYPO3\CMS\Lowlevel\Database\QueryGenerator\$table.

Referenced by TYPO3\CMS\Lowlevel\Database\QueryGenerator\makeSelectorTable().

◆ getLanguageService()

◆ getProcessedValueExtra()

string TYPO3\CMS\Lowlevel\Database\QueryGenerator::getProcessedValueExtra (   $table,
  $fieldName,
  $fieldValue,
  $conf,
  $splitString 
)
protected

◆ getQuery()

◆ getQueryResultCode()

array TYPO3\CMS\Lowlevel\Database\QueryGenerator::getQueryResultCode (   $type,
array  $dataRows,
  $table 
)
protected

◆ getQuerySingle()

string TYPO3\CMS\Lowlevel\Database\QueryGenerator::getQuerySingle (   $conf,
  $first 
)
protected

Get single query

Parameters
array$conf
bool$first
Returns
‪string

Definition at line 2444 of file QueryGenerator.php.

References TYPO3\CMS\Lowlevel\Database\QueryGenerator\cleanInputVal().

Referenced by TYPO3\CMS\Lowlevel\Database\QueryGenerator\getFormElements(), and TYPO3\CMS\Lowlevel\Database\QueryGenerator\getQuery().

◆ getSelectQuery()

◆ getSubscript()

array TYPO3\CMS\Lowlevel\Database\QueryGenerator::getSubscript (   $arr)
protected

Get subscript

Parameters
array$arr
Returns
‪array

Definition at line 2357 of file QueryGenerator.php.

Referenced by TYPO3\CMS\Lowlevel\Database\QueryGenerator\procesData().

◆ getTreeList()

string TYPO3\CMS\Lowlevel\Database\QueryGenerator::getTreeList (   $id,
  $depth,
  $begin = 0,
  $permsClause = '' 
)
protected

Recursively fetch all descendants of a given page

Parameters
int$id‪uid of the page
int$depth
int$begin
string$permsClause
Returns
‪string comma separated list of descendant pages

Definition at line 1094 of file QueryGenerator.php.

References TYPO3\CMS\Core\Database\Connection\PARAM_INT, and TYPO3\CMS\Core\Database\Query\QueryHelper\stripLogicalOperatorPrefix().

Referenced by TYPO3\CMS\Lowlevel\Database\QueryGenerator\getSelectQuery(), TYPO3\CMS\Lowlevel\Database\QueryGenerator\makeOptionList(), and TYPO3\CMS\Lowlevel\Database\QueryGenerator\makeValueList().

◆ init()

TYPO3\CMS\Lowlevel\Database\QueryGenerator::init (   $name,
  $table,
  $fieldList = '',
array  $settings = [] 
)
protected

◆ initStoreArray()

array TYPO3\CMS\Lowlevel\Database\QueryGenerator::initStoreArray ( )
protected

◆ isDateOfIso8601Format()

bool TYPO3\CMS\Lowlevel\Database\QueryGenerator::isDateOfIso8601Format (   $date)
protected

Checks if the given value is of the ISO 8601 format.

Parameters
mixed$date
Returns
‪bool

Definition at line 2427 of file QueryGenerator.php.

Referenced by TYPO3\CMS\Lowlevel\Database\QueryGenerator\convertIso8601DatetimeStringToUnixTimestamp().

◆ loadStoreQueryConfigs()

array TYPO3\CMS\Lowlevel\Database\QueryGenerator::loadStoreQueryConfigs (   $storeQueryConfigs,
  $storeIndex,
  $writeArray 
)
protected

Load store query configs

Parameters
array$storeQueryConfigs
int$storeIndex
array$writeArray
Returns
‪array

Definition at line 649 of file QueryGenerator.php.

Referenced by TYPO3\CMS\Lowlevel\Database\QueryGenerator\procesStoreControl().

◆ makeComparisonSelector()

string TYPO3\CMS\Lowlevel\Database\QueryGenerator::makeComparisonSelector (   $subscript,
  $fieldName,
  $conf 
)
protected

◆ makeFieldList()

string TYPO3\CMS\Lowlevel\Database\QueryGenerator::makeFieldList ( )
protected

Make a list of fields for current table

Returns
‪string Separated list of fields

Definition at line 1401 of file QueryGenerator.php.

References $GLOBALS, and TYPO3\CMS\Lowlevel\Database\QueryGenerator\$table.

Referenced by TYPO3\CMS\Lowlevel\Database\QueryGenerator\init().

◆ makeOptionList()

◆ makeSelectorTable()

◆ makeStoreControl()

◆ makeValueList()

◆ mkCompSelect()

string TYPO3\CMS\Lowlevel\Database\QueryGenerator::mkCompSelect (   $name,
  $comparison,
  $neg 
)
protected

Make comparison select

Parameters
string$name
string$comparison
int$neg
Returns
‪string

Definition at line 2337 of file QueryGenerator.php.

References TYPO3\CMS\Lowlevel\Database\QueryGenerator\$name.

Referenced by TYPO3\CMS\Lowlevel\Database\QueryGenerator\makeComparisonSelector().

◆ mkFieldToInputSelect()

string TYPO3\CMS\Lowlevel\Database\QueryGenerator::mkFieldToInputSelect (   $name,
  $fieldName 
)
protected

◆ mkOperatorSelect()

string TYPO3\CMS\Lowlevel\Database\QueryGenerator::mkOperatorSelect (   $name,
  $op,
  $draw,
  $submit 
)
protected

Make operator select

Parameters
string$name
string$op
bool$draw
bool$submit
Returns
‪string

Definition at line 2187 of file QueryGenerator.php.

References TYPO3\CMS\Lowlevel\Database\QueryGenerator\$name.

Referenced by TYPO3\CMS\Lowlevel\Database\QueryGenerator\getFormElements().

◆ mkTableSelect()

string TYPO3\CMS\Lowlevel\Database\QueryGenerator::mkTableSelect (   $name,
  $cur 
)
protected

◆ mkTypeSelect()

string TYPO3\CMS\Lowlevel\Database\QueryGenerator::mkTypeSelect (   $name,
  $fieldName,
  $prepend = 'FIELD_' 
)
protected

◆ printCodeArray()

string TYPO3\CMS\Lowlevel\Database\QueryGenerator::printCodeArray (   $codeArr,
  $recursionLevel = 0 
)
protected

Print code array

Parameters
array$codeArr
int$recursionLevel
Returns
‪string

Definition at line 2150 of file QueryGenerator.php.

Referenced by TYPO3\CMS\Lowlevel\Database\QueryGenerator\makeSelectorTable().

◆ procesData()

TYPO3\CMS\Lowlevel\Database\QueryGenerator::procesData (   $qC = [])
protected

◆ procesStoreControl()

◆ queryMaker()

◆ renderNoResultsFoundMessage()

TYPO3\CMS\Lowlevel\Database\QueryGenerator::renderNoResultsFoundMessage ( )
private

◆ resultRowDisplay()

◆ resultRowTitles()

string TYPO3\CMS\Lowlevel\Database\QueryGenerator::resultRowTitles (   $row,
  $conf 
)
protected

Render table header

Parameters
array$row‪Table columns
array$conf‪Table TCA
Returns
‪string HTML of table header

Definition at line 1357 of file QueryGenerator.php.

References TYPO3\CMS\Lowlevel\Database\QueryGenerator\$fieldName, and TYPO3\CMS\Lowlevel\Database\QueryGenerator\getLanguageService().

Referenced by TYPO3\CMS\Lowlevel\Database\QueryGenerator\getQueryResultCode(), and TYPO3\CMS\Lowlevel\Database\QueryGenerator\search().

◆ saveQueryInAction()

◆ search()

◆ setAndCleanUpExternalLists()

TYPO3\CMS\Lowlevel\Database\QueryGenerator::setAndCleanUpExternalLists (   $name,
  $list,
  $force = '' 
)
protected

◆ setFormName()

TYPO3\CMS\Lowlevel\Database\QueryGenerator::setFormName (   $formName)

Sets the current name of the input form.

Parameters
string$formName‪The name of the form.

Definition at line 485 of file QueryGenerator.php.

References TYPO3\CMS\Lowlevel\Database\QueryGenerator\$formName.

Referenced by TYPO3\CMS\Lowlevel\Database\QueryGenerator\queryMaker().

◆ updateIcon()

string TYPO3\CMS\Lowlevel\Database\QueryGenerator::updateIcon ( )
protected

◆ verifyComparison()

int TYPO3\CMS\Lowlevel\Database\QueryGenerator::verifyComparison (   $comparison,
  $neg 
)
protected

Verify comparison

Parameters
string$comparison
int$neg
Returns
‪int

Definition at line 2258 of file QueryGenerator.php.

Referenced by TYPO3\CMS\Lowlevel\Database\QueryGenerator\cleanUpQueryConfig().

◆ verifyType()

string TYPO3\CMS\Lowlevel\Database\QueryGenerator::verifyType (   $fieldName)
protected

Verify type

Parameters
string$fieldName
Returns
‪string

Definition at line 2237 of file QueryGenerator.php.

References TYPO3\CMS\Lowlevel\Database\QueryGenerator\$fieldName.

Referenced by TYPO3\CMS\Lowlevel\Database\QueryGenerator\cleanUpQueryConfig().

Member Data Documentation

◆ $comp_offsets

array TYPO3\CMS\Lowlevel\Database\QueryGenerator::$comp_offsets
protected
Initial value:
= array(
'text' => 0,
'number' => 1,
'multiple' => 2,
'relation' => 2,
'date' => 3,
'time' => 3,
'boolean' => 4,
'binary' => 5,
)

Definition at line 206 of file QueryGenerator.php.

◆ $compSQL

array TYPO3\CMS\Lowlevel\Database\QueryGenerator::$compSQL
protected

Definition at line 149 of file QueryGenerator.php.

◆ $enablePrefix

bool TYPO3\CMS\Lowlevel\Database\QueryGenerator::$enablePrefix = false
protected

Definition at line 253 of file QueryGenerator.php.

◆ $enableQueryParts

bool TYPO3\CMS\Lowlevel\Database\QueryGenerator::$enableQueryParts = false
protected

Definition at line 257 of file QueryGenerator.php.

◆ $extFieldLists

array TYPO3\CMS\Lowlevel\Database\QueryGenerator::$extFieldLists = array( )
protected

Definition at line 243 of file QueryGenerator.php.

◆ $fieldList

string TYPO3\CMS\Lowlevel\Database\QueryGenerator::$fieldList
protected

◆ $fieldName

◆ $fields

array TYPO3\CMS\Lowlevel\Database\QueryGenerator::$fields = array( )
protected

◆ $formName

string TYPO3\CMS\Lowlevel\Database\QueryGenerator::$formName = ''
protected

◆ $hookArray

array TYPO3\CMS\Lowlevel\Database\QueryGenerator::$hookArray = array( )
protected

Definition at line 60 of file QueryGenerator.php.

◆ $iconFactory

IconFactory TYPO3\CMS\Lowlevel\Database\QueryGenerator::$iconFactory
protected

Definition at line 68 of file QueryGenerator.php.

◆ $lang

array TYPO3\CMS\Lowlevel\Database\QueryGenerator::$lang
protected

Definition at line 88 of file QueryGenerator.php.

◆ $menuItems

array TYPO3\CMS\Lowlevel\Database\QueryGenerator::$menuItems = array( )
protected

information on the menu of this module

Definition at line 80 of file QueryGenerator.php.

Referenced by TYPO3\CMS\Lowlevel\Database\QueryGenerator\__construct().

◆ $moduleName

string TYPO3\CMS\Lowlevel\Database\QueryGenerator::$moduleName
protected

◆ $name

◆ $noDownloadB

int TYPO3\CMS\Lowlevel\Database\QueryGenerator::$noDownloadB = 0
protected

Definition at line 56 of file QueryGenerator.php.

◆ $queryConfig

◆ $settings

array TYPO3\CMS\Lowlevel\Database\QueryGenerator::$settings = array( )
protected

Settings, usually from the controller

Definition at line 76 of file QueryGenerator.php.

Referenced by TYPO3\CMS\Lowlevel\Database\QueryGenerator\__construct(), and TYPO3\CMS\Lowlevel\Database\QueryGenerator\init().

◆ $showFieldAndTableNames

bool TYPO3\CMS\Lowlevel\Database\QueryGenerator::$showFieldAndTableNames = false
protected

If the current user is an admin and $GLOBALS['TYPO3_CONF_VARS']['BE']['debug'] is set to true, the names of fields and tables are displayed.

Definition at line 268 of file QueryGenerator.php.

◆ $storeList

string TYPO3\CMS\Lowlevel\Database\QueryGenerator::$storeList = 'search_query_smallparts,search_result_labels,labels_noprefix,show_deleted,queryConfig,queryTable,queryFields,queryLimit,queryOrder,queryOrderDesc,queryOrder2,queryOrder2Desc,queryGroup,search_query_makeQuery'
protected

Definition at line 52 of file QueryGenerator.php.

◆ $table

◆ $tableArray

array TYPO3\CMS\Lowlevel\Database\QueryGenerator::$tableArray = array( )
protected

Definition at line 72 of file QueryGenerator.php.