TYPO3CMS  8
 All Classes Namespaces Files Functions Variables Pages
QueryGenerator Class Reference

Public Member Functions

 makeFieldList ()
 
 init ($name, $table, $fieldList= '')
 
 setAndCleanUpExternalLists ($name, $list, $force= '')
 
 procesData ($qC= '')
 
 cleanUpQueryConfig ($queryConfig)
 
 getFormElements ($subLevel=0, $queryConfig= '', $parent= '')
 
 makeOptionList ($fieldName, $conf, $table)
 
 printCodeArray ($codeArr, $recursionLevel=0)
 
 mkOperatorSelect ($name, $op, $draw, $submit)
 
 mkTypeSelect ($name, $fieldName, $prepend= 'FIELD_')
 
 verifyType ($fieldName)
 
 verifyComparison ($comparison, $neg)
 
 mkFieldToInputSelect ($name, $fieldName)
 
 mkTableSelect ($name, $cur)
 
 mkCompSelect ($name, $comparison, $neg)
 
 getSubscript ($arr)
 
 initUserDef ()
 
 userDef ($fieldPrefix, $conf, $fieldName, $fieldType)
 
 userDefCleanUp ($queryConfig)
 
 getQuery ($queryConfig, $pad= '')
 
 getQuerySingle ($conf, $first)
 
 cleanInputVal ($conf, $suffix= '')
 
 getUserDefQuery ($qcArr, $first)
 
 updateIcon ()
 
 getLabelCol ()
 
 makeSelectorTable ($modSettings, $enableList= 'table, fields, query, group, order, limit')
 
 getTreeList ($id, $depth, $begin=0, $permClause)
 
 getSelectQuery ($qString= '')
 
 setFormName ($formName)
 

Public Attributes

 $lang
 
 $compSQL
 
 $comp_offsets
 
 $noWrap = ' nowrap'
 
 $name
 
 $table
 
 $tableArray
 
 $fieldList
 
 $fields = []
 
 $extFieldLists = []
 
 $queryConfig = []
 
 $enablePrefix = false
 
 $enableQueryParts = false
 

Protected Member Functions

 makeComparisonSelector ($subscript, $fieldName, $conf)
 
 getDateTimePickerField ($name, $timestamp, $type)
 
 getBackendUserAuthentication ()
 
 getModule ()
 
 getLanguageService ()
 

Protected Attributes

 $formName = ''
 
 $limitBegin
 
 $limitLength
 
 $fieldName
 

Detailed Description

Class for generating front end for building queries

Definition at line 29 of file QueryGenerator.php.

Member Function Documentation

cleanInputVal (   $conf,
  $suffix = '' 
)

Clear input value

Parameters
array$conf
string$suffix
Returns
string

Definition at line 1333 of file QueryGenerator.php.

References GeneralUtility\intExplode().

Referenced by QueryGenerator\cleanUpQueryConfig(), and QueryGenerator\getQuerySingle().

cleanUpQueryConfig (   $queryConfig)
getBackendUserAuthentication ( )
protected
getDateTimePickerField (   $name,
  $timestamp,
  $type 
)
protected
Parameters
string$namethe field name
int$timestampthe unix timestamp
string$type[datetime, date, time, timesec, year]
Returns
string

Definition at line 1663 of file QueryGenerator.php.

References $GLOBALS, QueryGenerator\$name, and StringUtility\getUniqueId().

Referenced by QueryGenerator\getFormElements().

getFormElements (   $subLevel = 0,
  $queryConfig = '',
  $parent = '' 
)
getLabelCol ( )

Get label column

Returns
string

Definition at line 1381 of file QueryGenerator.php.

References $GLOBALS, and QueryGenerator\$table.

Referenced by QueryGenerator\makeSelectorTable().

getLanguageService ( )
protected
Returns
LanguageService

Definition at line 1711 of file QueryGenerator.php.

References $GLOBALS.

Referenced by QueryGenerator\init(), QueryGenerator\makeOptionList(), and QueryGenerator\mkTableSelect().

getModule ( )
protected
Returns
BaseScriptClass

Definition at line 1703 of file QueryGenerator.php.

References $GLOBALS.

Referenced by QueryGenerator\getSelectQuery(), QueryGenerator\makeOptionList(), and QueryGenerator\makeSelectorTable().

getQuery (   $queryConfig,
  $pad = '' 
)

Get query

Parameters
array$queryConfig
string$pad
Returns
string

Definition at line 1257 of file QueryGenerator.php.

References QueryGenerator\$queryConfig, QueryGenerator\getQuerySingle(), and QueryGenerator\getUserDefQuery().

Referenced by QueryGenerator\getSelectQuery().

getQuerySingle (   $conf,
  $first 
)

Get single query

Parameters
array$conf
bool$first
Returns
string

Definition at line 1286 of file QueryGenerator.php.

References QueryGenerator\cleanInputVal(), and GeneralUtility\makeInstance().

Referenced by QueryGenerator\getFormElements(), and QueryGenerator\getQuery().

getSubscript (   $arr)

Get subscript

Parameters
array$arr
Returns
array

Definition at line 1203 of file QueryGenerator.php.

Referenced by QueryGenerator\procesData().

getTreeList (   $id,
  $depth,
  $begin = 0,
  $permClause 
)

Get tree list

Parameters
int$id
int$depth
int$begin
string$permClause
Returns
string

Definition at line 1543 of file QueryGenerator.php.

References GeneralUtility\makeInstance(), and QueryHelper\stripLogicalOperatorPrefix().

Referenced by QueryGenerator\getSelectQuery(), and QueryGenerator\makeOptionList().

getUserDefQuery (   $qcArr,
  $first 
)

Get user definition query

Parameters
array$qcArr
bool$first
Returns
void

Definition at line 1362 of file QueryGenerator.php.

Referenced by QueryGenerator\getQuery().

init (   $name,
  $table,
  $fieldList = '' 
)

Init function

Parameters
string$nameThe name
string$tableThe table name
string$fieldListThe field list
Returns
void

Definition at line 283 of file QueryGenerator.php.

References QueryGenerator\$fieldList, QueryGenerator\$fieldName, $GLOBALS, QueryGenerator\$name, QueryGenerator\$table, QueryGenerator\getLanguageService(), QueryGenerator\initUserDef(), QueryGenerator\makeFieldList(), and GeneralUtility\trimExplode().

initUserDef ( )

Init user definition

Returns
void

Definition at line 1220 of file QueryGenerator.php.

Referenced by QueryGenerator\init().

makeComparisonSelector (   $subscript,
  $fieldName,
  $conf 
)
protected
Parameters
string$subscript
string$fieldName
array$conf
Returns
string

Definition at line 746 of file QueryGenerator.php.

References QueryGenerator\$fieldName, QueryGenerator\mkCompSelect(), and QueryGenerator\mkTypeSelect().

Referenced by QueryGenerator\getFormElements().

makeFieldList ( )

Make a list of fields for current table

Returns
string Separated list of fields

Definition at line 251 of file QueryGenerator.php.

References $GLOBALS, and QueryGenerator\$table.

Referenced by QueryGenerator\init().

mkCompSelect (   $name,
  $comparison,
  $neg 
)

Make comparison select

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

Definition at line 1183 of file QueryGenerator.php.

References QueryGenerator\$name.

Referenced by QueryGenerator\makeComparisonSelector().

mkFieldToInputSelect (   $name,
  $fieldName 
)

Make field to input select

Parameters
string$name
string$fieldName
Returns
string

Definition at line 1131 of file QueryGenerator.php.

References QueryGenerator\$fieldName, QueryGenerator\$name, QueryGenerator\getBackendUserAuthentication(), and QueryGenerator\updateIcon().

Referenced by QueryGenerator\makeSelectorTable().

mkOperatorSelect (   $name,
  $op,
  $draw,
  $submit 
)

Make operator select

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

Definition at line 1045 of file QueryGenerator.php.

References QueryGenerator\$name.

Referenced by QueryGenerator\getFormElements().

mkTableSelect (   $name,
  $cur 
)

Make table select

Parameters
string$name
string$cur
Returns
string

Definition at line 1161 of file QueryGenerator.php.

References $GLOBALS, QueryGenerator\$name, QueryGenerator\getBackendUserAuthentication(), and QueryGenerator\getLanguageService().

Referenced by QueryGenerator\makeSelectorTable().

mkTypeSelect (   $name,
  $fieldName,
  $prepend = 'FIELD_' 
)

Make type select

Parameters
string$name
string$fieldName
string$prepend
Returns
string

Definition at line 1067 of file QueryGenerator.php.

References QueryGenerator\$fieldName, QueryGenerator\$name, and QueryGenerator\getBackendUserAuthentication().

Referenced by QueryGenerator\makeComparisonSelector(), and QueryGenerator\makeSelectorTable().

printCodeArray (   $codeArr,
  $recursionLevel = 0 
)

Print code array

Parameters
array$codeArr
int$recursionLevel
Returns
string

Definition at line 1009 of file QueryGenerator.php.

Referenced by QueryGenerator\makeSelectorTable().

procesData (   $qC = '')

Process data

Parameters
string$qCQuery config
Returns
void

Definition at line 430 of file QueryGenerator.php.

References QueryGenerator\$queryConfig, GeneralUtility\_POST(), and QueryGenerator\getSubscript().

Referenced by QueryGenerator\makeSelectorTable().

setAndCleanUpExternalLists (   $name,
  $list,
  $force = '' 
)

Set and clean up external lists

Parameters
string$nameThe name
string$listThe list
string$force
Returns
void

Definition at line 412 of file QueryGenerator.php.

References QueryGenerator\$fieldName, QueryGenerator\$fields, QueryGenerator\$name, and GeneralUtility\trimExplode().

Referenced by QueryGenerator\makeSelectorTable().

setFormName (   $formName)

Sets the current name of the input form.

Parameters
string$formNameThe name of the form.
Returns
void

Definition at line 1687 of file QueryGenerator.php.

References QueryGenerator\$formName.

updateIcon ( )
userDef (   $fieldPrefix,
  $conf,
  $fieldName,
  $fieldType 
)

User definition

Parameters
string$fieldPrefix
array$conf
string$fieldName
string$fieldType
Returns
string

Definition at line 1234 of file QueryGenerator.php.

Referenced by QueryGenerator\getFormElements().

userDefCleanUp (   $queryConfig)

User definition clean up

Parameters
array$queryConfig
Returns
array

Definition at line 1245 of file QueryGenerator.php.

References QueryGenerator\$queryConfig.

Referenced by QueryGenerator\cleanUpQueryConfig().

verifyComparison (   $comparison,
  $neg 
)

Verify comparison

Parameters
string$comparison
int$neg
Returns
int

Definition at line 1109 of file QueryGenerator.php.

Referenced by QueryGenerator\cleanUpQueryConfig().

verifyType (   $fieldName)

Verify type

Parameters
string$fieldName
Returns
string

Definition at line 1088 of file QueryGenerator.php.

References QueryGenerator\$fieldName.

Referenced by QueryGenerator\cleanUpQueryConfig().

Member Data Documentation

$comp_offsets
Initial value:
= [
'text' => 0

Definition at line 154 of file QueryGenerator.php.

$compSQL
Initial value:
= [
'0' => '#FIELD# LIKE \'%#VALUE#%\''

Definition at line 96 of file QueryGenerator.php.

$enablePrefix = false

Definition at line 219 of file QueryGenerator.php.

$enableQueryParts = false

Definition at line 224 of file QueryGenerator.php.

$extFieldLists = []

Definition at line 207 of file QueryGenerator.php.

$fieldList

Definition at line 195 of file QueryGenerator.php.

Referenced by QueryGenerator\getSelectQuery(), and QueryGenerator\init().

$fields = []

Definition at line 202 of file QueryGenerator.php.

Referenced by QueryGenerator\setAndCleanUpExternalLists().

$formName = ''
protected

Definition at line 229 of file QueryGenerator.php.

Referenced by QueryGenerator\setFormName().

$lang
Initial value:
= [
'OR' => 'or'

Definition at line 34 of file QueryGenerator.php.

$limitBegin
protected

Definition at line 234 of file QueryGenerator.php.

$limitLength
protected

Definition at line 239 of file QueryGenerator.php.

Referenced by QueryGenerator\makeSelectorTable().

$noWrap = ' nowrap'

Definition at line 169 of file QueryGenerator.php.

$tableArray

Definition at line 188 of file QueryGenerator.php.