$_templates
$_templates : array
List of sprintf templates that will be used for compiling the SQL for this query. There are some clauses that can be built as just as the direct concatenation of the internal parts, those are listed here.
Responsible for compiling a Query object into its SQL representation for SQL Server
compile(\Cake\Database\Query $query, \Cake\Database\ValueBinder $generator) : \Closure
Returns the SQL representation of the provided query after generating the placeholders for the bound values using the provided generator
\Cake\Database\Query | $query | The query that is being compiled |
\Cake\Database\ValueBinder | $generator | the placeholder generator to be used in expressions |
_sqlCompiler(string $sql, \Cake\Database\Query $query, \Cake\Database\ValueBinder $generator) : \Closure
Returns a callable object that can be used to compile a SQL string representation of this query.
string | $sql | initial sql string to append to |
\Cake\Database\Query | $query | The query that is being compiled |
\Cake\Database\ValueBinder | $generator | The placeholder and value binder object |
_buildSelectPart(array $parts, \Cake\Database\Query $query, \Cake\Database\ValueBinder $generator) : string
Helper function used to build the string representation of a SELECT clause, it constructs the field list taking care of aliasing and converting expression objects to string. This function also constructs the DISTINCT clause for the query.
array | $parts | list of fields to be transformed to string |
\Cake\Database\Query | $query | The query that is being compiled |
\Cake\Database\ValueBinder | $generator | the placeholder generator to be used in expressions |
_buildFromPart(array $parts, \Cake\Database\Query $query, \Cake\Database\ValueBinder $generator) : string
Helper function used to build the string representation of a FROM clause, it constructs the tables list taking care of aliasing and converting expression objects to string.
array | $parts | list of tables to be transformed to string |
\Cake\Database\Query | $query | The query that is being compiled |
\Cake\Database\ValueBinder | $generator | the placeholder generator to be used in expressions |
_buildJoinPart(array $parts, \Cake\Database\Query $query, \Cake\Database\ValueBinder $generator) : string
Helper function used to build the string representation of multiple JOIN clauses, it constructs the joins list taking care of aliasing and converting expression objects to string in both the table to be joined and the conditions to be used.
array | $parts | list of joins to be transformed to string |
\Cake\Database\Query | $query | The query that is being compiled |
\Cake\Database\ValueBinder | $generator | the placeholder generator to be used in expressions |
_buildSetPart(array $parts, \Cake\Database\Query $query, \Cake\Database\ValueBinder $generator) : string
Helper function to generate SQL for SET expressions.
array | $parts | List of keys & values to set. |
\Cake\Database\Query | $query | The query that is being compiled |
\Cake\Database\ValueBinder | $generator | the placeholder generator to be used in expressions |
_buildUnionPart(array $parts, \Cake\Database\Query $query, \Cake\Database\ValueBinder $generator) : string
Builds the SQL string for all the UNION clauses in this query, when dealing with query objects it will also transform them using their configured SQL dialect.
array | $parts | list of queries to be operated with UNION |
\Cake\Database\Query | $query | The query that is being compiled |
\Cake\Database\ValueBinder | $generator | the placeholder generator to be used in expressions |
_buildInsertPart(array $parts, \Cake\Database\Query $query, \Cake\Database\ValueBinder $generator) : string
Generates the INSERT part of a SQL query
To better handle concurrency and low transaction isolation levels, we also include an OUTPUT clause so we can ensure we get the inserted row's data back.
array | $parts | The parts to build |
\Cake\Database\Query | $query | The query that is being compiled |
\Cake\Database\ValueBinder | $generator | the placeholder generator to be used in expressions |
_buildValuesPart(array $parts, \Cake\Database\Query $query, \Cake\Database\ValueBinder $generator) : string
Builds the SQL fragment for INSERT INTO.
array | $parts | The values parts. |
\Cake\Database\Query | $query | The query that is being compiled |
\Cake\Database\ValueBinder | $generator | the placeholder generator to be used in expressions |
SQL fragment.
_buildUpdatePart(array $parts, \Cake\Database\Query $query, \Cake\Database\ValueBinder $generator) : string
Builds the SQL fragment for UPDATE.
array | $parts | The update parts. |
\Cake\Database\Query | $query | The query that is being compiled |
\Cake\Database\ValueBinder | $generator | the placeholder generator to be used in expressions |
SQL fragment.
_buildModifierPart(array $parts, \Cake\Database\Query $query, \Cake\Database\ValueBinder $generator) : string
Builds the SQL modifier fragment
array | $parts | The query modifier parts |
\Cake\Database\Query | $query | The query that is being compiled |
\Cake\Database\ValueBinder | $generator | the placeholder generator to be used in expressions |
SQL fragment.
_stringifyExpressions(array $expressions, \Cake\Database\ValueBinder $generator, boolean $wrap = true) : array
Helper function used to covert ExpressionInterface objects inside an array into their string representation.
array | $expressions | list of strings and ExpressionInterface objects |
\Cake\Database\ValueBinder | $generator | the placeholder generator to be used in expressions |
boolean | $wrap | Whether to wrap each expression object with parenthesis |
_buildLimitPart(integer $limit, \Cake\Database\Query $query) : string
Generates the LIMIT part of a SQL query
integer | $limit | the limit clause |
\Cake\Database\Query | $query | The query that is being compiled |