TYPO3  7.6
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
AbstractCompiler Class Reference
Inheritance diagram for AbstractCompiler:
Adodb Mysql

Public Member Functions

 __construct (DatabaseConnection $databaseConnection)
 
 compileSQL ($components)
 
 compileFieldList ($selectFields, $compileComments=true, $functionMapping=true)
 
 compileWhereClause ($clauseArray, $functionMapping=true)
 
 compileFromTables ($tablesArray)
 

Protected Member Functions

 compileSELECT ($components)
 
 compileUPDATE ($components)
 
 compileINSERT ($components)
 
 compileDELETE ($components)
 
 compileCREATETABLE ($components)
 
 compileALTERTABLE ($components)
 
 compileTRUNCATETABLE (array $components)
 
 compileAddslashes ($str)
 
 compileJoinIdentifier ($identifierParts)
 
 compileCaseStatement (array $components, $functionMapping=true)
 

Protected Attributes

 $databaseConnection
 

Detailed Description

Abstract base class for SQL compilers

Definition at line 22 of file AbstractCompiler.php.

Constructor & Destructor Documentation

__construct ( DatabaseConnection  $databaseConnection)
Parameters
\TYPO3\CMS\Dbal\Database\DatabaseConnection$databaseConnection

Definition at line 32 of file AbstractCompiler.php.

References AbstractCompiler\$databaseConnection.

Member Function Documentation

compileAddslashes (   $str)
abstractprotected

Add slashes function used for compiling queries This method overrides the method from because the input string is already properly escaped.

Parameters
string$strInput string
Returns
string Output string

Referenced by AbstractCompiler\compileFromTables(), and AbstractCompiler\compileUPDATE().

compileALTERTABLE (   $components)
abstractprotected

Compiles an ALTER TABLE statement from components array

Parameters
arrayArray of SQL query components
Returns
string SQL ALTER TABLE query
See Also
parseALTERTABLE()

Referenced by AbstractCompiler\compileSQL().

compileCaseStatement ( array  $components,
  $functionMapping = true 
)
protected

Compiles a CASE ... WHEN flow-control construct based on input array (made with ->parseCaseStatement())

Parameters
array$componentsArray of case components, (made with ->parseCaseStatement())
bool$functionMappingWhether function mapping should take place
Returns
string case when string
See Also
parseCaseStatement()

Definition at line 303 of file AbstractCompiler.php.

References AbstractCompiler\compileWhereClause(), and elseif.

Referenced by Mysql\compileFieldList(), and Adodb\compileFieldList().

compileCREATETABLE (   $components)
abstractprotected

Compiles a CREATE TABLE statement from components array

Parameters
array$componentsArray of SQL query components
Returns
array array with SQL CREATE TABLE/INDEX command(s)
See Also
parseCREATETABLE()

Referenced by AbstractCompiler\compileSQL().

compileDELETE (   $components)
protected

Compiles an DELETE statement from components array

Parameters
array$componentsArray of SQL query components
Returns
string SQL DELETE query
See Also
parseDELETE()

Definition at line 143 of file AbstractCompiler.php.

References AbstractCompiler\compileWhereClause().

Referenced by AbstractCompiler\compileSQL().

compileFieldList (   $selectFields,
  $compileComments = true,
  $functionMapping = true 
)
abstract

Compiles a "SELECT [output] FROM..:" field list based on input array (made with ->parseFieldList()) Can also compile field lists for ORDER BY and GROUP BY.

Parameters
array$selectFieldsArray of select fields, (made with ->parseFieldList())
bool$compileCommentsWhether comments should be compiled
bool$functionMappingWhether function mapping should take place
Returns
string Select field string
See Also
parseFieldList()

Referenced by AbstractCompiler\compileSELECT().

compileFromTables (   $tablesArray)

Compiles a "FROM [output] WHERE..:" table list based on input array (made with ->parseFromTables())

Parameters
array$tablesArrayArray of table names, (made with ->parseFromTables())
Returns
string Table name string
See Also
parseFromTables()

Definition at line 253 of file AbstractCompiler.php.

References AbstractCompiler\compileAddslashes(), and AbstractCompiler\compileJoinIdentifier().

Referenced by AbstractCompiler\compileSELECT().

compileINSERT (   $components)
abstractprotected

Compiles an INSERT statement from components array

Parameters
array$componentsArray of SQL query components
Returns
string SQL INSERT query
See Also
parseINSERT()

Referenced by AbstractCompiler\compileSQL().

compileJoinIdentifier (   $identifierParts)
protected

Compile a "JOIN table ON [output] = ..." identifier

Parameters
array$identifierPartsArray of identifier parts
Returns
string
See Also
parseCastStatement()
parseFromTables()

Definition at line 234 of file AbstractCompiler.php.

Referenced by AbstractCompiler\compileFromTables().

compileSELECT (   $components)
protected

Compiles a SELECT statement from components array

Parameters
array$componentsArray of SQL query components
Returns
string SQL SELECT query
See Also
parseSELECT()

Definition at line 86 of file AbstractCompiler.php.

References AbstractCompiler\compileFieldList(), AbstractCompiler\compileFromTables(), and AbstractCompiler\compileWhereClause().

Referenced by AbstractCompiler\compileSQL(), Mysql\compileWhereClause(), and Adodb\compileWhereClause().

compileSQL (   $components)

Compiles an SQL query from components

Parameters
array$componentsArray of SQL query components
Returns
string SQL query
See Also
parseSQL()

Definition at line 44 of file AbstractCompiler.php.

References AbstractCompiler\compileALTERTABLE(), AbstractCompiler\compileCREATETABLE(), AbstractCompiler\compileDELETE(), AbstractCompiler\compileINSERT(), AbstractCompiler\compileSELECT(), AbstractCompiler\compileTRUNCATETABLE(), and AbstractCompiler\compileUPDATE().

compileTRUNCATETABLE ( array  $components)
protected

Compiles a TRUNCATE TABLE statement from components array

Parameters
array$componentsArray of SQL query components
Returns
string SQL TRUNCATE TABLE query
See Also
parseTRUNCATETABLE()

Definition at line 178 of file AbstractCompiler.php.

Referenced by AbstractCompiler\compileSQL().

compileUPDATE (   $components)
protected

Compiles an UPDATE statement from components array

Parameters
array$componentsArray of SQL query components
Returns
string SQL UPDATE query
See Also
parseUPDATE()

Definition at line 111 of file AbstractCompiler.php.

References AbstractCompiler\compileAddslashes(), and AbstractCompiler\compileWhereClause().

Referenced by AbstractCompiler\compileSQL().

compileWhereClause (   $clauseArray,
  $functionMapping = true 
)
abstract

Implodes an array of WHERE clause configuration into a WHERE clause.

DBAL-specific: The only(!) handled "calc" operators supported by parseWhereClause() are:

  • the bitwise logical and (&)
  • the addition (+)
  • the substraction (-)
  • the multiplication (*)
  • the division (/)
  • the modulo (%)
Parameters
array$clauseArray
bool$functionMapping
Returns
string WHERE clause as string.
See Also
::parseWhereClause()

Referenced by AbstractCompiler\compileCaseStatement(), AbstractCompiler\compileDELETE(), AbstractCompiler\compileSELECT(), and AbstractCompiler\compileUPDATE().

Member Data Documentation

$databaseConnection
protected

Definition at line 27 of file AbstractCompiler.php.

Referenced by AbstractCompiler\__construct().