TYPO3 CMS  TYPO3_6-2
TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser Class Reference
Inheritance diagram for TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser:
TYPO3\CMS\Core\SingletonInterface

Public Member Functions

 __construct ()
 
 initializeObject ()
 
 preparseQuery (QueryInterface $query)
 
 normalizeParameterIdentifier ($identifier)
 
 parseQuery (QueryInterface $query)
 
 addDynamicQueryParts (QuerySettingsInterface $querySettings, array &$sql)
 

Protected Member Functions

 preparseComparison ($comparison, $qomPath='')
 
 parseSource (Qom\SourceInterface $source, array &$sql)
 
 parseConstraint (Qom\ConstraintInterface $constraint=NULL, Qom\SourceInterface $source, array &$sql)
 
 parseOrderings (array $orderings, Qom\SourceInterface $source, array &$sql)
 
 parseComparison (Qom\ComparisonInterface $comparison, Qom\SourceInterface $source, array &$sql)
 
 parseDynamicOperand (Qom\ComparisonInterface $comparison, Qom\SourceInterface $source, array &$sql)
 
 parseOperand (Qom\DynamicOperandInterface $operand, Qom\SourceInterface $source, array &$sql)
 
 addRecordTypeConstraint ($className, &$sql)
 
 addAdditionalWhereClause (QuerySettingsInterface $querySettings, $tableName, &$sql)
 
 addVisibilityConstraintStatement (QuerySettingsInterface $querySettings, $tableName, array &$sql)
 
 getFrontendConstraintStatement ($tableName, $ignoreEnableFields, array $enableFieldsToBeIgnored=array(), $includeDeleted)
 
 getBackendConstraintStatement ($tableName, $ignoreEnableFields, $includeDeleted)
 
 addSysLanguageStatement ($tableName, array &$sql, $querySettings)
 
 addPageIdStatement ($tableName, array &$sql, array $storagePageIds)
 
 parseJoin (Qom\JoinInterface $join, array &$sql)
 
 getPlainValue ($input)
 
 addUnionStatement (&$className, &$tableName, &$propertyPath, array &$sql)
 
 resolveOperator ($operator)
 
 getPageRepository ()
 

Protected Attributes

 $databaseHandle
 
 $dataMapper
 
 $pageRepository
 
 $cacheManager
 
 $tableColumnCache
 
 $environmentService
 

Detailed Description

QueryParser, converting the qom to string representation

Definition at line 27 of file Typo3DbQueryParser.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser::__construct ( )

Constructor. takes the database handle from $GLOBALS['TYPO3_DB']

Definition at line 69 of file Typo3DbQueryParser.php.

References $GLOBALS.

Member Function Documentation

◆ addAdditionalWhereClause()

TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser::addAdditionalWhereClause ( QuerySettingsInterface  $querySettings,
  $tableName,
$sql 
)
protected

◆ addDynamicQueryParts()

TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser::addDynamicQueryParts ( QuerySettingsInterface  $querySettings,
array &  $sql 
)

Add query parts that MUST NOT be cached. Call this function for any query

Parameters
QuerySettingsInterface$querySettings
array$sql
Exceptions

Definition at line 222 of file Typo3DbQueryParser.php.

References TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser\addVisibilityConstraintStatement().

◆ addPageIdStatement()

TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser::addPageIdStatement (   $tableName,
array &  $sql,
array  $storagePageIds 
)
protected

Builds the page ID checking statement

Parameters
string$tableNameThe database table name
array&$sqlThe query parts
array$storagePageIdslist of storage page ids
Exceptions

Definition at line 641 of file Typo3DbQueryParser.php.

References $GLOBALS.

Referenced by TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser\addAdditionalWhereClause().

◆ addRecordTypeConstraint()

TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser::addRecordTypeConstraint (   $className,
$sql 
)
protected

Add a constraint to ensure that the record type of the returned tuples is matching the data type of the repository.

Parameters
string$classNameThe class name
array&$sqlThe query parts
Returns
void

Definition at line 468 of file Typo3DbQueryParser.php.

References $sql.

Referenced by TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser\parseJoin(), and TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser\parseSource().

◆ addSysLanguageStatement()

TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser::addSysLanguageStatement (   $tableName,
array &  $sql,
  $querySettings 
)
protected

Builds the language field statement

Parameters
string$tableNameThe database table name
array&$sqlThe query parts
QuerySettingsInterface$querySettingsThe TYPO3 CMS specific query settings
Returns
void

Definition at line 592 of file Typo3DbQueryParser.php.

References $GLOBALS.

Referenced by TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser\addAdditionalWhereClause().

◆ addUnionStatement()

TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser::addUnionStatement ( $className,
$tableName,
$propertyPath,
array &  $sql 
)
protected

◆ addVisibilityConstraintStatement()

◆ getBackendConstraintStatement()

TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser::getBackendConstraintStatement (   $tableName,
  $ignoreEnableFields,
  $includeDeleted 
)
protected

Returns constraint statement for backend context

Parameters
string$tableName
bool$ignoreEnableFieldsA flag indicating whether the enable fields should be ignored
bool$includeDeletedA flag indicating whether deleted records should be included
Returns
string

Definition at line 573 of file Typo3DbQueryParser.php.

References TYPO3\CMS\Backend\Utility\BackendUtility\BEenableFields(), and TYPO3\CMS\Backend\Utility\BackendUtility\deleteClause().

Referenced by TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser\addVisibilityConstraintStatement().

◆ getFrontendConstraintStatement()

TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser::getFrontendConstraintStatement (   $tableName,
  $ignoreEnableFields,
array  $enableFieldsToBeIgnored = array(),
  $includeDeleted 
)
protected

Returns constraint statement for frontend context

Parameters
string$tableName
bool$ignoreEnableFieldsA flag indicating whether the enable fields should be ignored
array$enableFieldsToBeIgnoredIf $ignoreEnableFields is true, this array specifies enable fields to be ignored. If it is NULL or an empty array (default) all enable fields are ignored.
bool$includeDeletedA flag indicating whether deleted records should be included
Returns
string
Exceptions

Definition at line 548 of file Typo3DbQueryParser.php.

References TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser\getPageRepository().

Referenced by TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser\addVisibilityConstraintStatement().

◆ getPageRepository()

◆ getPlainValue()

TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser::getPlainValue (   $input)
protected

Returns a plain value, i.e. objects are flattened out if possible.

Parameters
mixed$input
Exceptions

Definition at line 705 of file Typo3DbQueryParser.php.

References TYPO3\CMS\Extbase\Utility\TypeHandlingUtility\isCoreType().

Referenced by TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser\parseComparison(), and TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser\preparseComparison().

◆ initializeObject()

TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser::initializeObject ( )

Lifecycle method

Returns
void

Definition at line 78 of file Typo3DbQueryParser.php.

◆ normalizeParameterIdentifier()

TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser::normalizeParameterIdentifier (   $identifier)

◆ parseComparison()

◆ parseConstraint()

TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser::parseConstraint ( Qom\ConstraintInterface  $constraint = NULL,
Qom\SourceInterface  $source,
array &  $sql 
)
protected

Transforms a constraint into SQL and parameter arrays

Parameters
Qom\ConstraintInterface$constraintThe constraint
Qom\SourceInterface$sourceThe source
array&$sqlThe query parts
Returns
void

Definition at line 261 of file Typo3DbQueryParser.php.

References $sql, and TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser\parseComparison().

Referenced by TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser\parseQuery().

◆ parseDynamicOperand()

TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser::parseDynamicOperand ( Qom\ComparisonInterface  $comparison,
Qom\SourceInterface  $source,
array &  $sql 
)
protected

Parse a DynamicOperand into SQL and parameter arrays.

Parameters
Qom\ComparisonInterface$comparison
Qom\SourceInterface$sourceThe source
array&$sqlThe query parts
Returns
void

Definition at line 413 of file Typo3DbQueryParser.php.

References TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser\normalizeParameterIdentifier(), TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser\parseOperand(), and TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser\resolveOperator().

Referenced by TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser\parseComparison().

◆ parseJoin()

TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser::parseJoin ( Qom\JoinInterface  $join,
array &  $sql 
)
protected

Transforms a Join into SQL and parameter arrays

Parameters
Qom\JoinInterface$joinThe join
array&$sqlThe query parts
Returns
void

Definition at line 669 of file Typo3DbQueryParser.php.

References TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser\addRecordTypeConstraint().

Referenced by TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser\parseSource().

◆ parseOperand()

TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser::parseOperand ( Qom\DynamicOperandInterface  $operand,
Qom\SourceInterface  $source,
array &  $sql 
)
protected
Parameters
Qom\DynamicOperandInterface$operand
Qom\SourceInterface$sourceThe source
array&$sqlThe query parts
Returns
string
Exceptions

Definition at line 435 of file Typo3DbQueryParser.php.

References $sql, and TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser\addUnionStatement().

Referenced by TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser\parseDynamicOperand().

◆ parseOrderings()

TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser::parseOrderings ( array  $orderings,
Qom\SourceInterface  $source,
array &  $sql 
)
protected

◆ parseQuery()

◆ parseSource()

TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser::parseSource ( Qom\SourceInterface  $source,
array &  $sql 
)
protected

Transforms a Query Source into SQL and parameter arrays

Parameters
Qom\SourceInterface$sourceThe source
array&$sql
Returns
void

Definition at line 241 of file Typo3DbQueryParser.php.

References TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser\addRecordTypeConstraint(), and TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser\parseJoin().

Referenced by TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser\parseQuery().

◆ preparseComparison()

TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser::preparseComparison (   $comparison,
  $qomPath = '' 
)
protected

Walks through the qom's constraints and extracts the properties and values.

In the qom the query structure and values are glued together. This walks through the qom and only extracts the parts necessary for generating the hash and filling the statement. It leaves out the actual statement generation, as it is the most time consuming.

Parameters
Qom\ConstraintInterface$comparisonThe constraint. Could be And-, Or-, Not- or ComparisonInterface
string$qomPathcurrent position of the child in the qom
Returns
array Array of parameters and operators
Exceptions

Definition at line 115 of file Typo3DbQueryParser.php.

References $parameters, TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser\getPlainValue(), TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser\normalizeParameterIdentifier(), and TYPO3\CMS\Extbase\Persistence\QueryInterface\OPERATOR_IN.

Referenced by TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser\preparseQuery().

◆ preparseQuery()

TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser::preparseQuery ( QueryInterface  $query)

◆ resolveOperator()

Member Data Documentation

◆ $cacheManager

TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser::$cacheManager
protected

Definition at line 53 of file Typo3DbQueryParser.php.

◆ $databaseHandle

TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser::$databaseHandle
protected

Definition at line 34 of file Typo3DbQueryParser.php.

◆ $dataMapper

TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser::$dataMapper
protected

Definition at line 40 of file Typo3DbQueryParser.php.

◆ $environmentService

TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser::$environmentService
protected

Definition at line 64 of file Typo3DbQueryParser.php.

◆ $pageRepository

TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser::$pageRepository
protected

◆ $tableColumnCache

TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser::$tableColumnCache
protected

Definition at line 58 of file Typo3DbQueryParser.php.