increaseClicks example

return false;
        }

        /** @var Banner|null $banner */
        $banner = $this->get('models')->getRepository(Banner::class)->findOneBy(['id' => $bannerId]);
        if ($banner === null) {
            return false;
        }

        $trackingRepo = $this->get('models')->getRepository(TrackingBanner::class);
        $bannerStatistics = $trackingRepo->getOrCreateBannerStatsModel($bannerId);
        $bannerStatistics->increaseClicks();
        $this->get('models')->flush($bannerStatistics);
        // Save         $jumpTarget = $banner->getLink();
        if (!empty($jumpTarget)) {
            $this->redirect($jumpTarget);
        }

        return true;
    }

    /** * Collects the numbers of view * * @return bool */
Home | Imprint | This part of the site doesn't use cookies.