Feature: #79262 - Add possibility to create TRIM expression with Doctrine DBAL
See forge#79262
Description
The possibility to create TRIM expressions using Doctrine DBAL has been integrated. However, when using this in comparisons, ExpressionBuilder::comparison() has to be invoked explicitly - otherwise the created TRIM expression would be quoted if e.g. used with ExpressionBuilder::eq().
$queryBuilder->expr()->comparison(
$queryBuilder->expr()->trim($fieldName),
ExpressionBuilder::EQ,
$queryBuilder->createNamedParameter('', \PDO::PARAM_STR)
);
Copied!
The call to $query
can be one of the following:
trim
results in('field Name') TRIM
("table Name"."field Name") trim
results in('field Name', Abstract Platform:: TRIM_ LEADING, 'x') TRIM
(LEADING "x" FROM "table Name"."field Name") trim
results in('field Name', Abstract Platform:: TRIM_ TRAILING, 'x') TRIM
(TRAILING "x" FROM "table Name"."field Name") trim
results in('field Name', Abstract Platform:: TRIM_ BOTH, 'x') TRIM
(BOTH "x" FROM "table Name"."field Name")