File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
tests/Rules/Doctrine/ORM/data Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,9 @@ public function processArgs(
3434 {
3535 $ args = [];
3636 foreach ($ methodCallArgs as $ arg ) {
37+ if ($ arg ->unpack ) {
38+ throw new DynamicQueryBuilderArgumentException ();
39+ }
3740 $ value = $ scope ->getType ($ arg ->value );
3841 if (
3942 $ value instanceof ExprType
Original file line number Diff line number Diff line change @@ -291,12 +291,17 @@ public function qbExprMethod(): void
291291 $ queryBuilder ->getQuery ();
292292 }
293293
294- public function bug602 (array $ objectConditions ): void
294+ public function bug602 (array $ objectConditions, bool $ rand ): void
295295 {
296+ $ orParts = ['e.title LIKE :termLike ' ];
297+ if ($ rand ) {
298+ $ orParts [] = 'p.version = :term ' ;
299+ }
296300 $ queryBuilder = $ this ->entityManager ->createQueryBuilder ();
297301 $ queryBuilder ->select ('e ' )
298302 ->from (MyEntity::class, 'e ' )
299- ->andWhere ($ queryBuilder ->expr ()->orX (...$ objectConditions ));
303+ ->andWhere ($ queryBuilder ->expr ()->orX (...$ orParts ))
304+ ->setParameter ('termLike ' , 'someTerm ' );
300305 }
301306
302307}
You can’t perform that action at this time.
0 commit comments