$builder =
$this->
createProductImpressionBuilder($offset,
$limit);
if ($from instanceof DateTimeInterface
) { $builder->
andWhere('articleImpression.date >= :fromDate'
) ->
setParameter(':fromDate',
$from->
format('Y-m-d H:i:s'
));
} if ($to instanceof DateTimeInterface
) { $builder->
andWhere('articleImpression.date <= :toDate'
) ->
setParameter(':toDate',
$to->
format('Y-m-d H:i:s'
));
} if ($sort !==
[]) { $this->
addSort($builder,
$sort);
} if (!
empty($shopIds)) { foreach ($shopIds as $shopId) { $shopId =
(int) $shopId;
$builder->
addSelect( 'SUM(IF(articleImpression.shopId = ' .
$shopId . ', articleImpression.impressions, 0)) as totalImpressions' .
$shopId );
} } $builder =
$this->eventManager->
filter('Shopware_Analytics_ProductImpressions',
$builder,
[