{ $this->
addCondition($condition,
$query);
} private function addCondition(WidthCondition
$condition, QueryBuilder
$query): void
{ $this->variantHelper->
joinVariants($query);
$min = ':minWidth' .
md5(json_encode($condition, JSON_THROW_ON_ERROR
));
$max = ':maxWidth' .
md5(json_encode($condition, JSON_THROW_ON_ERROR
));
if ($condition->
getMinWidth() > 0
) { $query->
andWhere('allVariants.width >= ' .
$min);
$query->
setParameter($min,
$condition->
getMinWidth());
} if ($condition->
getMaxWidth() > 0
) { $query->
andWhere('allVariants.width <= ' .
$max);
$query->
setParameter($max,
$condition->
getMaxWidth());
} }}