File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed
src/lib/Persistence/Legacy/Content/Type/Gateway/CriterionHandler Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change 99namespace Ibexa \Core \Persistence \Legacy \Content \Type \Gateway \CriterionHandler ;
1010
1111use Doctrine \DBAL \Connection ;
12- use Doctrine \DBAL \ParameterType ;
1312use Doctrine \DBAL \Query \QueryBuilder ;
1413use Ibexa \Contracts \Core \Persistence \Content \Type \CriterionHandlerInterface ;
1514use Ibexa \Contracts \Core \Repository \Values \ContentType \Query \Criterion \ContentTypeGroupName as ContentTypeGroupNameCriterion ;
@@ -36,14 +35,15 @@ public function apply(
3635 CriterionInterface $ criterion
3736 ): string {
3837 $ subQuery = $ qb ->getConnection ()->createQueryBuilder ();
39- $ whereClause = is_array ($ criterion ->getValue ())
40- ? $ subQuery ->expr ()->in (
41- 'LOWER(ctg.name) ' ,
42- $ qb ->createNamedParameter (array_map ('strtolower ' , $ criterion ->getValue ()), Connection::PARAM_STR_ARRAY )
43- ) : $ subQuery ->expr ()->eq (
44- 'LOWER(ctg.name) ' ,
45- $ qb ->createNamedParameter (strtolower ($ criterion ->getValue ()), ParameterType::STRING )
46- );
38+ $ value = $ criterion ->getValue ();
39+ if (!is_array ($ value )) {
40+ $ value = [$ value ];
41+ }
42+
43+ $ whereClause = $ subQuery ->expr ()->in (
44+ 'LOWER(ctg.name) ' ,
45+ $ qb ->createNamedParameter (array_map ('strtolower ' , $ value ), Connection::PARAM_STR_ARRAY )
46+ );
4747
4848 $ subQuery
4949 ->select ('g.contentclass_id ' )
You can’t perform that action at this time.
0 commit comments