{ $this->
addCondition($condition,
$query);
} private function addCondition(WeightCondition
$condition, QueryBuilder
$query): void
{ $this->variantHelper->
joinVariants($query);
$min = ':minLength' .
md5(json_encode($condition, JSON_THROW_ON_ERROR
));
$max = ':maxLength' .
md5(json_encode($condition, JSON_THROW_ON_ERROR
));
if ($condition->
getMinWeight() > 0
) { $query->
andWhere('allVariants.weight >= ' .
$min);
$query->
setParameter($min,
$condition->
getMinWeight());
} if ($condition->
getMaxWeight() > 0
) { $query->
andWhere('allVariants.weight <= ' .
$max);
$query->
setParameter($max,
$condition->
getMaxWeight());
} }}