TYPO3
7.6
|
Public Member Functions | |
injectDataMapper (\TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper $dataMapper) | |
injectCacheManager (\TYPO3\CMS\Core\Cache\CacheManager $cacheManager) | |
injectEnvironmentService (\TYPO3\CMS\Extbase\Service\EnvironmentService $environmentService) | |
__construct () | |
initializeObject () | |
preparseQuery (QueryInterface $query) | |
normalizeParameterIdentifier ($identifier) | |
parseQuery (QueryInterface $query) | |
addDynamicQueryParts (QuerySettingsInterface $querySettings, array &$sql) | |
Protected Member Functions | |
preparseComparison ($comparison, $qomPath= '') | |
addNullConditionToStatementIfRequired (array $sql, $statement, $tableAlias) | |
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) | |
getAdditionalMatchFieldsStatement ($columnMap, $childTableName, $childTableAlias, $parentTable=null) | |
getAdditionalWhereClause (QuerySettingsInterface $querySettings, $tableName, $tableAlias=null) | |
getVisibilityConstraintStatement (QuerySettingsInterface $querySettings, $tableName, $tableAlias) | |
getFrontendConstraintStatement ($tableName, $ignoreEnableFields, array $enableFieldsToBeIgnored=array(), $includeDeleted) | |
getBackendConstraintStatement ($tableName, $ignoreEnableFields, $includeDeleted) | |
getSysLanguageStatement ($tableName, $tableAlias, $querySettings) | |
getPageIdStatement ($tableName, $tableAlias, array $storagePageIds) | |
parseJoin (Qom\JoinInterface $join, array &$sql) | |
getUniqueAlias (array &$sql, $tableName, $fullPropertyPath=null) | |
addUnionStatement (&$className, &$tableName, &$propertyPath, array &$sql, &$fullPropertyPath) | |
replaceTableNameWithAlias ($statement, $tableName, $tableAlias) | |
resolveOperator ($operator) | |
getPageRepository () | |
Protected Attributes | |
$databaseHandle | |
$dataMapper | |
$pageRepository | |
$cacheManager | |
$tableColumnCache | |
$environmentService | |
$tablePropertyMap = array() | |
QueryParser, converting the qom to string representation
Definition at line 27 of file Typo3DbQueryParser.php.
__construct | ( | ) |
Constructor. takes the database handle from $GLOBALS['TYPO3_DB']
Definition at line 100 of file Typo3DbQueryParser.php.
References $GLOBALS.
addDynamicQueryParts | ( | QuerySettingsInterface | $querySettings, |
array & | $sql | ||
) |
Add query parts that MUST NOT be cached. Call this function for any query
QuerySettingsInterface | $querySettings | |
array | $sql |
\InvalidArgumentException |
Definition at line 262 of file Typo3DbQueryParser.php.
References Typo3DbQueryParser\addNullConditionToStatementIfRequired(), and Typo3DbQueryParser\getVisibilityConstraintStatement().
|
protected |
If the given table alias is used in a UNION statement it is required to add an additional condition that allows the fields of the joined table to be NULL. Otherwise the condition would be too strict and filter out records that are actually valid.
array | $sql | The current SQL query parts. |
string | $statement | The SQL statement to which the NULL condition should be added. |
string | $tableAlias | The table alias used in the SQL statement. |
Definition at line 287 of file Typo3DbQueryParser.php.
Referenced by Typo3DbQueryParser\addDynamicQueryParts(), and Typo3DbQueryParser\parseQuery().
|
protected |
Add a constraint to ensure that the record type of the returned tuples is matching the data type of the repository.
string | $className | The class name |
array | &$sql | The query parts |
Definition at line 527 of file Typo3DbQueryParser.php.
Referenced by Typo3DbQueryParser\parseJoin(), and Typo3DbQueryParser\parseSource().
|
protected |
adds a union statement to the query, mostly for tables referenced in the where condition. The property for which the union statement is generated will be appended.
string | &$className | The name of the parent class, will be set to the child class after processing. |
string | &$tableName | The name of the parent table, will be set to the table alias that is used in the union statement. |
array | &$propertyPath | The remaining property path, will be cut of by one part during the process. |
array | &$sql | The SQL statement parts, will be filled with the union statements. |
string | $fullPropertyPath | The full path the the current property, will be used to make table names unique. |
\TYPO3\CMS\Extbase\Persistence\Generic\Exception | |
\TYPO3\CMS\Extbase\Persistence\Generic\Exception\InvalidRelationConfigurationException | |
\TYPO3\CMS\Extbase\Persistence\Generic\Exception\MissingColumnMapException |
Definition at line 873 of file Typo3DbQueryParser.php.
References elseif, Typo3DbQueryParser\getAdditionalMatchFieldsStatement(), Typo3DbQueryParser\getUniqueAlias(), ColumnMap\RELATION_HAS_AND_BELONGS_TO_MANY, ColumnMap\RELATION_HAS_MANY, and ColumnMap\RELATION_HAS_ONE.
Referenced by Typo3DbQueryParser\parseComparison(), Typo3DbQueryParser\parseOperand(), and Typo3DbQueryParser\parseOrderings().
|
protected |
Builds a condition for filtering records by the configured match field, e.g. MM_match_fields, foreign_match_fields or foreign_table_field.
ColumnMap | $columnMap | The column man for which the condition should be build. |
string | $childTableName | The real name of the child record table. |
string | $childTableAlias | The alias of the child record table used in the query. |
string | $parentTable | The real name of the parent table (used for building the foreign_table_field condition). |
Definition at line 564 of file Typo3DbQueryParser.php.
Referenced by Typo3DbQueryParser\addUnionStatement(), and Typo3DbQueryParser\parseComparison().
|
protected |
Adds additional WHERE statements according to the query settings.
QuerySettingsInterface | $querySettings | The TYPO3 CMS specific query settings |
string | $tableName | The table name to add the additional where clause for |
string | $tableAlias | The table alias used in the query. |
Definition at line 595 of file Typo3DbQueryParser.php.
References elseif, Typo3DbQueryParser\getPageIdStatement(), QuerySettingsInterface\getRespectStoragePage(), QuerySettingsInterface\getRespectSysLanguage(), QuerySettingsInterface\getStoragePageIds(), and Typo3DbQueryParser\getSysLanguageStatement().
Referenced by Typo3DbQueryParser\parseQuery().
|
protected |
Returns constraint statement for backend context
string | $tableName | |
bool | $ignoreEnableFields | A flag indicating whether the enable fields should be ignored |
bool | $includeDeleted | A flag indicating whether deleted records should be included |
Definition at line 683 of file Typo3DbQueryParser.php.
References BackendUtility\BEenableFields(), and BackendUtility\deleteClause().
Referenced by Typo3DbQueryParser\getVisibilityConstraintStatement().
|
protected |
Returns constraint statement for frontend context
string | $tableName | |
bool | $ignoreEnableFields | A flag indicating whether the enable fields should be ignored |
array | $enableFieldsToBeIgnored | If $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 | $includeDeleted | A flag indicating whether deleted records should be included |
InconsistentQuerySettingsException |
Definition at line 657 of file Typo3DbQueryParser.php.
References elseif, and Typo3DbQueryParser\getPageRepository().
Referenced by Typo3DbQueryParser\getVisibilityConstraintStatement().
|
protected |
Builds the page ID checking statement
string | $tableName | The database table name |
string | $tableAlias | The table alias used in the query. |
array | $storagePageIds | list of storage page ids |
InconsistentQuerySettingsException |
Definition at line 754 of file Typo3DbQueryParser.php.
References $GLOBALS.
Referenced by Typo3DbQueryParser\getAdditionalWhereClause().
|
protected |
Definition at line 1002 of file Typo3DbQueryParser.php.
References $GLOBALS, and Typo3DbQueryParser\$pageRepository.
Referenced by Typo3DbQueryParser\getFrontendConstraintStatement().
|
protected |
Builds the language field statement
string | $tableName | The database table name |
string | $tableAlias | The table alias used in the query. |
QuerySettingsInterface | $querySettings | The TYPO3 CMS specific query settings |
Definition at line 703 of file Typo3DbQueryParser.php.
References $GLOBALS.
Referenced by Typo3DbQueryParser\getAdditionalWhereClause().
|
protected |
Generates a unique alias for the given table and the given property path. The property path will be mapped to the generated alias in the tablePropertyMap.
array | $sql | The SQL satement parts, will be filled with the tableAliasMap. |
string | $tableName | The name of the table for which the alias should be generated. |
string | $fullPropertyPath | The full property path that is related to the given table. |
Definition at line 838 of file Typo3DbQueryParser.php.
Referenced by Typo3DbQueryParser\addUnionStatement(), Typo3DbQueryParser\parseJoin(), and Typo3DbQueryParser\parseSource().
|
protected |
Adds enableFields and deletedClause to the query if necessary
QuerySettingsInterface | $querySettings | |
string | $tableName | The database table name |
string | $tableAlias |
Definition at line 626 of file Typo3DbQueryParser.php.
References $GLOBALS, Typo3DbQueryParser\getBackendConstraintStatement(), QuerySettingsInterface\getEnableFieldsToBeIgnored(), Typo3DbQueryParser\getFrontendConstraintStatement(), QuerySettingsInterface\getIgnoreEnableFields(), QuerySettingsInterface\getIncludeDeleted(), and Typo3DbQueryParser\replaceTableNameWithAlias().
Referenced by Typo3DbQueryParser\addDynamicQueryParts().
initializeObject | ( | ) |
injectCacheManager | ( | \TYPO3\CMS\Core\Cache\CacheManager | $cacheManager | ) |
\TYPO3\CMS\Core\Cache\CacheManager | $cacheManager |
Definition at line 74 of file Typo3DbQueryParser.php.
References Typo3DbQueryParser\$cacheManager.
injectDataMapper | ( | \TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper | $dataMapper | ) |
\TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper | $dataMapper |
Definition at line 66 of file Typo3DbQueryParser.php.
References Typo3DbQueryParser\$dataMapper.
injectEnvironmentService | ( | \TYPO3\CMS\Extbase\Service\EnvironmentService | $environmentService | ) |
\TYPO3\CMS\Extbase\Service\EnvironmentService | $environmentService |
Definition at line 82 of file Typo3DbQueryParser.php.
References Typo3DbQueryParser\$environmentService.
normalizeParameterIdentifier | ( | $identifier | ) |
normalizes the parameter's identifier
string | $identifier |
Definition at line 212 of file Typo3DbQueryParser.php.
Referenced by Typo3DbQueryParser\parseComparison(), Typo3DbQueryParser\parseDynamicOperand(), and Typo3DbQueryParser\preparseComparison().
|
protected |
Parse a Comparison into SQL and parameter arrays.
Qom\ComparisonInterface | $comparison | The comparison to parse |
Qom\SourceInterface | $source | The source |
array | &$sql | SQL query parts to add to |
\RuntimeException | |
\TYPO3\CMS\Extbase\Persistence\Generic\Exception\RepositoryException |
Definition at line 401 of file Typo3DbQueryParser.php.
References Typo3DbQueryParser\addUnionStatement(), elseif, Typo3DbQueryParser\getAdditionalMatchFieldsStatement(), ColumnMap\getTypeOfRelation(), Typo3DbQueryParser\normalizeParameterIdentifier(), QueryInterface\OPERATOR_CONTAINS, QueryInterface\OPERATOR_IN, Typo3DbQueryParser\parseDynamicOperand(), ColumnMap\RELATION_HAS_AND_BELONGS_TO_MANY, and ColumnMap\RELATION_HAS_MANY.
Referenced by Typo3DbQueryParser\parseConstraint().
|
protected |
Transforms a constraint into SQL and parameter arrays
Qom\ConstraintInterface | $constraint | The constraint |
Qom\SourceInterface | $source | The source |
array | &$sql | The query parts |
Definition at line 325 of file Typo3DbQueryParser.php.
References elseif, and Typo3DbQueryParser\parseComparison().
Referenced by Typo3DbQueryParser\parseQuery().
|
protected |
Parse a DynamicOperand into SQL and parameter arrays.
Qom\ComparisonInterface | $comparison | |
Qom\SourceInterface | $source | The source |
array | &$sql | The query parts |
Definition at line 469 of file Typo3DbQueryParser.php.
References Typo3DbQueryParser\normalizeParameterIdentifier(), Typo3DbQueryParser\parseOperand(), and Typo3DbQueryParser\resolveOperator().
Referenced by Typo3DbQueryParser\parseComparison().
|
protected |
Transforms a Join into SQL and parameter arrays
Qom\JoinInterface | $join | The join |
array | &$sql | The query parts |
Definition at line 797 of file Typo3DbQueryParser.php.
References Typo3DbQueryParser\addRecordTypeConstraint(), and Typo3DbQueryParser\getUniqueAlias().
Referenced by Typo3DbQueryParser\parseSource().
|
protected |
Qom\DynamicOperandInterface | $operand | |
Qom\SourceInterface | $source | The source |
array | &$sql | The query parts |
\InvalidArgumentException |
Definition at line 492 of file Typo3DbQueryParser.php.
References Typo3DbQueryParser\addUnionStatement(), and elseif.
Referenced by Typo3DbQueryParser\parseDynamicOperand().
|
protected |
Transforms orderings into SQL.
array | $orderings | An array of orderings (Qom) |
Qom\SourceInterface | $source | The source |
array | &$sql | The query parts |
\TYPO3\CMS\Extbase\Persistence\Generic\Exception\UnsupportedOrderException |
Definition at line 357 of file Typo3DbQueryParser.php.
References Typo3DbQueryParser\addUnionStatement(), elseif, QueryInterface\ORDER_ASCENDING, and QueryInterface\ORDER_DESCENDING.
Referenced by Typo3DbQueryParser\parseQuery().
parseQuery | ( | QueryInterface | $query | ) |
Parses the query and returns the SQL statement parts.
QueryInterface | $query | The query |
Definition at line 223 of file Typo3DbQueryParser.php.
References Typo3DbQueryParser\addNullConditionToStatementIfRequired(), Typo3DbQueryParser\getAdditionalWhereClause(), QueryInterface\getConstraint(), QueryInterface\getLimit(), QueryInterface\getOffset(), QueryInterface\getOrderings(), QueryInterface\getQuerySettings(), QueryInterface\getSource(), Typo3DbQueryParser\parseConstraint(), Typo3DbQueryParser\parseOrderings(), and Typo3DbQueryParser\parseSource().
|
protected |
Transforms a Query Source into SQL and parameter arrays
Qom\SourceInterface | $source | The source |
array | &$sql |
Definition at line 303 of file Typo3DbQueryParser.php.
References Typo3DbQueryParser\addRecordTypeConstraint(), elseif, Typo3DbQueryParser\getUniqueAlias(), and Typo3DbQueryParser\parseJoin().
Referenced by Typo3DbQueryParser\parseQuery().
|
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.
Qom\ConstraintInterface | $comparison | The constraint. Could be And-, Or-, Not- or ComparisonInterface |
string | $qomPath | current position of the child in the qom |
\Exception |
Definition at line 149 of file Typo3DbQueryParser.php.
References elseif, Typo3DbQueryParser\normalizeParameterIdentifier(), and QueryInterface\OPERATOR_IN.
Referenced by Typo3DbQueryParser\preparseQuery().
preparseQuery | ( | QueryInterface | $query | ) |
Preparses the query and returns the query's hash and the parameters
QueryInterface | $query | The query |
Definition at line 121 of file Typo3DbQueryParser.php.
References QueryInterface\getConstraint(), QueryInterface\getOrderings(), QueryInterface\getQuerySettings(), QueryInterface\getSource(), and Typo3DbQueryParser\preparseComparison().
|
protected |
If the table name does not match the table alias all occurrences of "tableName." are replaced with "tableAlias." in the given SQL statement.
string | $statement | The SQL statement in which the values are replaced. |
string | $tableName | The table name that is replaced. |
string | $tableAlias | The table alias that replaced the table name. |
Definition at line 944 of file Typo3DbQueryParser.php.
Referenced by Typo3DbQueryParser\getVisibilityConstraintStatement().
|
protected |
Returns the SQL operator for the given JCR operator type.
string | $operator | One of the JCR_OPERATOR_* constants |
\TYPO3\CMS\Extbase\Persistence\Generic\Exception |
Definition at line 960 of file Typo3DbQueryParser.php.
References QueryInterface\OPERATOR_EQUAL_TO, QueryInterface\OPERATOR_EQUAL_TO_NULL, QueryInterface\OPERATOR_GREATER_THAN, QueryInterface\OPERATOR_GREATER_THAN_OR_EQUAL_TO, QueryInterface\OPERATOR_IN, QueryInterface\OPERATOR_LESS_THAN, QueryInterface\OPERATOR_LESS_THAN_OR_EQUAL_TO, QueryInterface\OPERATOR_LIKE, QueryInterface\OPERATOR_NOT_EQUAL_TO, and QueryInterface\OPERATOR_NOT_EQUAL_TO_NULL.
Referenced by Typo3DbQueryParser\parseDynamicOperand().
|
protected |
Definition at line 51 of file Typo3DbQueryParser.php.
Referenced by Typo3DbQueryParser\injectCacheManager().
|
protected |
Definition at line 34 of file Typo3DbQueryParser.php.
|
protected |
Definition at line 39 of file Typo3DbQueryParser.php.
Referenced by Typo3DbQueryParser\injectDataMapper().
|
protected |
Definition at line 61 of file Typo3DbQueryParser.php.
Referenced by Typo3DbQueryParser\injectEnvironmentService().
|
protected |
Definition at line 46 of file Typo3DbQueryParser.php.
Referenced by Typo3DbQueryParser\getPageRepository().
|
protected |
Definition at line 56 of file Typo3DbQueryParser.php.
|
protected |
Definition at line 95 of file Typo3DbQueryParser.php.