private function saveRecipientsList($recipients){ $data = new Gpf_Db_UserAttribute(); $data->setAccountUserId(Gpf_Session::getAuthUser()->getUserId()); $data->setName('RecipientsList'); try { $data->loadFromData(array(Gpf_Db_Table_UserAttributes::ACCOUNT_USER_ID,Gpf_Db_Table_UserAttributes::NAME)); $data->setValue($recipients); $data->save(); } catch(Gpf_DbEngine_NoRowException $e) { $data->setValue($recipients); $data->insert(); } }
private function deleteContact(Pap_common_user $user, $oldEmail) { if(!$this->isSubscribed) { return; } Gpf_Log::info('GetResponse - deleteContact'); $this->callFunction('delete_contact', array('contact' => $this->getContactId($oldEmail))); $userAttr = new Gpf_Db_UserAttribute(); $userAttr->setName(self::GET_RESPONSE_CONTACT_EMAIL); $userAttr->setAccountUserId($user->getAccountUserId()); $userAttr->loadFromData(); $userAttr->delete(); }
private static function setDefaultLanguageToAffiliate($accountUserId) { $attribute = new Gpf_Db_UserAttribute(); $attribute->setName(Gpf_Auth_User::LANGUAGE_ATTRIBUTE_NAME); $attribute->setAccountUserId($accountUserId); try { $attribute->loadFromData(array(Gpf_Db_Table_UserAttributes::NAME, Gpf_Db_Table_UserAttributes::ACCOUNT_USER_ID)); return; } catch (Gpf_DbEngine_NoRowException $e) { $attribute->set(Gpf_Db_Table_UserAttributes::VALUE, Gpf_Lang_Dictionary::getDefaultLanguage()); $attribute->save(); } }