S
S
Sergey Shevchenko2016-04-22 02:18:53
PHP
Sergey Shevchenko, 2016-04-22 02:18:53

PhpStorm complains about using Query Builder (Doctrine) in foreach. How to be?

Am I making the right request?
Some nestings (keys) in the array cannot come
fa4c375ea40c4e8086dc401e2cf45453.pngPhpStorm swears at the use of Query Builder in foreach
910d9bca81384c9a90beb527f5ce3944.png9fdc69eff37d4c219c9535b9063080c0.pngIn the current method I use several queryBuilders
910d9bca81384c9a90beb527f5ce3944.pngd1be08b7776141dca6d9dde40f000276.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Novikov, 2016-04-24
@BOOMER_74

$queryBuilder = $conn->createQueryBuilder();
He suggests moving this code outside of the foreach, as it has nothing to do with the variables in the loop. Reduce code to:
$conn->createQueryBuilder()->select(...);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question