// За форматирование извиняюсь - писал всё вручную
$qb = $this->createQueryBuilder('u')->select('...');
if ($statuses) {
$qb->innerJoin()
}
$all = $qb->getQuery()->getSingleScalarResult();
не все так просто, при таком разделении ошибка
[2016-08-14 02:51:23] request.CRITICAL: Uncaught PHP Exception Doctrine\Common\Annotations\AnnotationException: "[Semantical Error] The annotation "@Enum" in property Doctrine\ORM\Mapping\GeneratedValue::$strategy was never imported. Did you maybe forget to add a "use" statement for this annotation?" at /vagrant/api/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationException.php line 54 {"exception":"[object] (Doctrine\\Common\\Annotations\\AnnotationException(code: 0): [Semantical Error] The annotation \"@Enum\" in property Doctrine\\ORM\\Mapping\\GeneratedValue::$strategy was never imported. Did you maybe forget to add a \"use\" statement for this annotation? at /vagrant/api/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationException.php:54)"}