예제 #1
0
 public static function setSetting($name, $value, $accountId = null)
 {
     $setting = new Gpf_Db_Setting();
     $setting->set(self::NAME, $name);
     $setting->set(self::VALUE, $value);
     if ($accountId != null) {
         $setting->set(self::ACCOUNTID, $accountId);
     }
     $setting->save();
 }
예제 #2
0
 public function save()
 {
     $setting = new Gpf_Db_Setting();
     try {
         $setting->getSetting($this->getName(), $this->getAccountId());
         $this->setPrimaryKeyValue($setting->getPrimaryKeyValue());
         $this->update();
     } catch (Gpf_DbEngine_NoRowException $e) {
         $this->insert();
     } catch (Gpf_Settings_UnknownSettingException $e) {
         $this->insert();
     }
 }
예제 #3
0
 private function getMerchantNotificationEmail(Pap_Common_Campaign $campaign) {
     $setting = new Gpf_Db_Setting();
     $setting->setAccountId($campaign->getAccountId());
     $setting->setName(Pap_Settings::MERCHANT_NOTIFICATION_EMAIL);
     try{
         $setting->loadFromData(array(Gpf_Db_Table_Settings::ACCOUNTID, Gpf_Db_Table_Settings::NAME));
         if($setting->getValue() != '') {
             return $setting->getValue();
         }
     } catch (Gpf_Exception $e) {
     }
     return Pap_Common_User::getMerchantEmail();
 }