/** * @param String_type $attributeName * @param String $defaultValue * @return String */ private function getSettingWithDefaultValue($attributeName, $defaultValue) { try { return Gpf_Db_Table_UserAttributes::getSetting($attributeName, $this->user->getAccountUserId()); } catch (Gpf_DbEngine_NoRowException $e) { } return $defaultValue; }
public function isOverwriteEnabled(Pap_Common_Campaign $campaignObject = null, Pap_Common_User $userObject = null) { if ($userObject != null) { try { switch (Gpf_Db_Table_UserAttributes::getSetting(Pap_Settings::OVERWRITE_COOKIE, $userObject->getAccountUserId())) { case GPF::YES: return true; case GPF::NO: return false; default: break; } } catch (Gpf_Exception $e) { } } $campaignOverwrite = 'D'; if($campaignObject != null) { $campaignOverwrite = $campaignObject->getOverwriteCookie(); } switch ($campaignOverwrite) { case GPF::YES: return true; case GPF::NO: return false; default: return $this->isGeneralOverwriteAllowed(); } }
private function isRegistrationEmailSent(Pap_Common_User $user) { try { if (Gpf::YES == Gpf_Db_Table_UserAttributes::getSetting(self::AUTO_REGISTERED_AFFILIATE_REGISTRATION_EMAIL_SENT, $user->getAccountUserId())) { return true; } } catch (Gpf_DbEngine_NoRowException $e) { return false; } return false; }
public function getUserAttributeWithDefaultValue($attributeName, $defaultValue) { try { $value = Gpf_Db_Table_UserAttributes::getSetting($attributeName); } catch (Gpf_DbEngine_NoRowException $e) { $value = $defaultValue; Gpf_Db_Table_UserAttributes::setSetting($attributeName, $defaultValue); } return $value; }
private function isNotify(Pap_Common_User $user, $defaultSetting, $enabledSetting, $settingName, $transactionStatus = null, $transactionStatusSettingName = null) { $isNotify = $this->accountSettings->get($defaultSetting); try { if ($this->accountSettings->get($enabledSetting) == Gpf::YES) { $isNotify = Gpf_Db_Table_UserAttributes::getSetting($settingName, $user->getAccountUserId()); } } catch(Gpf_Exception $e) { } if ($transactionStatus == null) { return $isNotify; } if (strstr($this->accountSettings->get($transactionStatusSettingName), $transactionStatus) === false) { return Gpf::NO; } return $isNotify; }