if ($date === null
) { $date =
new DateTime();
} /** @var Banner|null $bannerStatistics */
$bannerStatistics =
$this->
findOneBy(['bannerId' =>
$bannerId, 'displayDate' =>
$date]);
// If no Entry for this day exists - create a new one
if (!
$bannerStatistics instanceof Banner
) { $bannerStatistics =
new Banner($bannerId,
$date);
$bannerStatistics->
setClicks(0
);
$bannerStatistics->
setViews(0
);
} return $bannerStatistics;
} /**
* Returns an instance of the \Doctrine\ORM\Query object which select the article impression
*
* @param int $articleId
* @param int $shopId
* @param DateTimeInterface|null $date
* @param string|null $deviceType
*
* @return Query<ArticleImpression>
*/