Class IdentifierQuoter
Contains all the logic related to quoting identifiers in a Query object
Method Summary
- 
          __construct() publicConstructor 
- 
          _basicQuoter() protectedA generic identifier quoting function used for various parts of the query 
- 
          _quoteComparison() protectedQuotes identifiers in expression objects implementing the field interface 
- 
          _quoteDelete() protectedQuotes all identifiers in each of the clauses of a DELETE query 
- 
          _quoteIdentifierExpression() protectedQuotes identifiers in "order by" expression objects 
- 
          _quoteInsert() protectedQuotes the table name and columns for an insert query 
- 
          _quoteJoins() protectedQuotes both the table and alias for an array of joins as stored in a Query object 
- 
          _quoteOrderBy() protectedQuotes identifiers in "order by" expression objects 
- 
          _quoteParts() protectedQuotes all identifiers in each of the clauses/parts of a query 
- 
          _quoteSelect() protectedQuotes all identifiers in each of the clauses of a SELECT query 
- 
          _quoteUpdate() protectedQuotes the table name for an update query 
- 
          quote() publicIterates over each of the clauses in a query looking for identifiers and quotes them 
- 
          quoteExpression() publicQuotes identifiers inside expression objects 
- 
          quoteIdentifier() publicQuotes a database identifier (a column name, table name, etc..) to be used safely in queries without the risk of using reserved words 
Method Detail
__construct() ¶ public
__construct(string $startQuote, string $endQuote)Constructor
Parameters
- 
                string$startQuote
- String used to start a database identifier quoting to make it safe. 
- 
                string$endQuote
- String used to end a database identifier quoting to make it safe. 
_basicQuoter() ¶ protected
_basicQuoter(array<string, mixed> $part): array<string, mixed>A generic identifier quoting function used for various parts of the query
Parameters
- 
                array<string, mixed>$part
- the part of the query to quote 
Returns
array<string, mixed>_quoteComparison() ¶ protected
_quoteComparison(Cake\Database\Expression\FieldInterface $expression): voidQuotes identifiers in expression objects implementing the field interface
Parameters
- 
                Cake\Database\Expression\FieldInterface$expression
- The expression to quote. 
Returns
void_quoteDelete() ¶ protected
_quoteDelete(Cake\Database\Query\DeleteQuery $query): voidQuotes all identifiers in each of the clauses of a DELETE query
Parameters
- 
                Cake\Database\Query\DeleteQuery$query
- The query to quote. 
Returns
void_quoteIdentifierExpression() ¶ protected
_quoteIdentifierExpression(Cake\Database\Expression\IdentifierExpression $expression): voidQuotes identifiers in "order by" expression objects
Parameters
- 
                Cake\Database\Expression\IdentifierExpression$expression
- The identifiers to quote. 
Returns
void_quoteInsert() ¶ protected
_quoteInsert(Cake\Database\Query\InsertQuery $query): voidQuotes the table name and columns for an insert query
Parameters
- 
                Cake\Database\Query\InsertQuery$query
- The insert query to quote. 
Returns
void_quoteJoins() ¶ protected
_quoteJoins(array $joins): array<string, array>Quotes both the table and alias for an array of joins as stored in a Query object
Parameters
- 
                array$joins
- The joins to quote. 
Returns
array<string, array>_quoteOrderBy() ¶ protected
_quoteOrderBy(Cake\Database\Expression\OrderByExpression $expression): voidQuotes identifiers in "order by" expression objects
Strings with spaces are treated as literal expressions and will not have identifiers quoted.
Parameters
- 
                Cake\Database\Expression\OrderByExpression$expression
- The expression to quote. 
Returns
void_quoteParts() ¶ protected
_quoteParts(Cake\Database\Query $query, array $parts): voidQuotes all identifiers in each of the clauses/parts of a query
Parameters
- 
                Cake\Database\Query$query
- The query to quote. 
- 
                array$parts
- Query clauses. 
Returns
void_quoteSelect() ¶ protected
_quoteSelect(Cake\Database\Query\SelectQuery<mixed> $query): voidQuotes all identifiers in each of the clauses of a SELECT query
Parameters
- 
                Cake\Database\Query\SelectQuery<mixed>$query
- The query to quote. 
Returns
void_quoteUpdate() ¶ protected
_quoteUpdate(Cake\Database\Query\UpdateQuery $query): voidQuotes the table name for an update query
Parameters
- 
                Cake\Database\Query\UpdateQuery$query
- The update query to quote. 
Returns
voidquote() ¶ public
quote(Cake\Database\Query $query): Cake\Database\QueryIterates over each of the clauses in a query looking for identifiers and quotes them
Parameters
- 
                Cake\Database\Query$query
- The query to have its identifiers quoted 
Returns
Cake\Database\QueryquoteExpression() ¶ public
quoteExpression(Cake\Database\ExpressionInterface $expression): voidQuotes identifiers inside expression objects
Parameters
- 
                Cake\Database\ExpressionInterface$expression
- The expression object to walk and quote. 
Returns
voidquoteIdentifier() ¶ public
quoteIdentifier(string $identifier): stringQuotes a database identifier (a column name, table name, etc..) to be used safely in queries without the risk of using reserved words
Parameters
- 
                string$identifier
- The identifier to quote. 
Returns
string