// But since only the filters are considered, the association is referenced only once.
// In this case we add the aggregation field as path to the criteria builder and the join group builder will consider this path for the sub-join logic
$paths =
array_filter([$this->
findToManyPath($aggregation,
$definition)]);
$query =
$this->criteriaQueryBuilder->
build($query,
$definition,
$clone,
$context,
$paths);
$query->
resetQueryPart('orderBy'
);
if ($criteria->
getTitle()) { $query->
setTitle($criteria->
getTitle() . '::aggregation::' .
$aggregation->
getName());
} $this->queryHelper->
addIdCondition($criteria,
$definition,
$query);
$table =
$definition->
getEntityName();
if (\
count($scoreCriteria->
getQueries()) > 0
) { $escapedTable = EntityDefinitionQueryHelper::
escape($table);
$scoreQuery =
new QueryBuilder($this->connection
);
$scoreQuery =
$this->criteriaQueryBuilder->
build($scoreQuery,
$definition,
$scoreCriteria,
$context,
$paths);
$pks =
$definition->
getFields()->
filterByFlag(PrimaryKey::
class)->
map(fn (StorageAware
$f) =>
$f->
getStorageName());
$join = '';