Beispiel #1
0
    public function save(Pap_Contexts_Impression $context) {
        $context->debug('  Saving impression started');

        $impression = $this->createRowImpression();
        $impression->setAccountId($context->getAccountId());
        $impression->setUserId($context->getUserObject()->getId());
        $impression->setBannerId($context->getBannerId());
        $impression->setParentBannerId($context->getParentBannerId());
        $impression->setCampaignId($context->getCampaignId());
        $impression->setChannel($context->getChannelId());
        $impression->setCountryCode('');
        if (!$this->isGeoIpImpressionsDisabled()) {
            $impression->setCountryCode($context->getCountryCode());
        }
        $impression->setData1($context->getClickData1());
        $impression->setData2($context->getClickData2());
        $time = new Gpf_DateTime($context->getDate());
        $impression->setTime($time->getHourStart()->toDateTime());

        try {
        	$this->saveAndIncrementImpressionCount($context, $impression);
        } catch (Gpf_Exception $e) {
        	$context->debug($this->_('Saving impression interrupted: %s', $e->getMessage()));
        }

        $context->debug('  Saving impression ended');
    }
    public function saveRotatorImpression(Pap_Contexts_Impression $context) {
        $context->debug('FEATURE BannerRotator: saveRotatorImpression started');

        $banner = $context->getBannerObject();
        if($banner != null && $context->getParentBannerId() != null){
            $banner->setParentBannerId($context->getParentBannerId());
            $context->debug('  FEATURE BannerRotator: Saving rotator impression');
            $this->saveChildImpression($banner, $context);
        } else {
            $context->debug('  FEATURE BannerRotator: Banner is not in rotator, skipping');
        }

        $context->debug('FEATURE BannerRotator: saveRotatorImpression ended');
        $context->debug('');
        return Gpf_Plugins_Engine::PROCESS_CONTINUE;
    }