public function getLinkingMethod(Pap_Common_Banner $banner = null) { if ($banner != null && $banner->getCampaignId() != '') { $campaign = new Pap_Common_Campaign(); $campaign->setId($banner->getCampaignId()); $campaign->load(); if ($campaign->getLinkingMethod() != self::LINKMETHOD_DEFAULT_VALUE && $campaign->getLinkingMethod() != null && $campaign->getLinkingMethod() != '') { return $campaign->getLinkingMethod(); } } return Gpf_Settings::get(Pap_Settings::SETTING_LINKING_METHOD); }
private function recognizeCampaign(Pap_Contexts_Action $context) { if ($this->banner == null) { return; } $context->debug("Checking campaign with Id: ".$this->banner->getCampaignId()); if ($this->banner->getCampaignId() != null) { try { $this->campaign = $this->getCampaign($this->banner->getCampaignId()); } catch (Gpf_Exception $e) { $context->debug("Campaign with id: " . $this->banner->getCampaignId() . " doesn't exist"); } } }
private function checkBanner(Pap_Contexts_Tracking $context, Pap_Common_Banner $banner) { if ($this->isAccountRecognizedNotFromDefault($context) && $banner->getAccountId() != $context->getAccountId()) { $context->debug("Banner with Id: ".$banner->getId()." and name '".$banner->getName()."' cannot be used with accountId: '". $context->getAccountId() ."'!"); throw new Gpf_Exception("Banner is from differen account"); } if (!is_null($context->getCampaignObject()) && $context->getCampaignObject()->getId() != $banner->getCampaignId()) { $context->debug("Banner with Id: ".$banner->getId()." cannot be used (it is from different campaign as recognized campaign)!"); throw new Gpf_Exception("Banner is from different campaign as recognized campaign!"); } }