本文整理匯總了PHP中SugarEmailAddress::save方法的典型用法代碼示例。如果您正苦於以下問題:PHP SugarEmailAddress::save方法的具體用法?PHP SugarEmailAddress::save怎麽用?PHP SugarEmailAddress::save使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類SugarEmailAddress
的用法示例。
在下文中一共展示了SugarEmailAddress::save方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: save
function save($id = '', $module = '', $new_addrs = array(), $primary = '', $replyTo = '', $invalid = '', $optOut = '', $in_workflow = false)
{
if (func_num_args() > 1) {
parent::save($id, $module, $new_addrs, $primary, $replyTo, $invalid, $optOut, $in_workflow);
} else {
SugarBean::save($id);
}
}
示例2: setup
public function setup()
{
global $current_user;
$current_user = SugarTestUserUtilities::createAnonymousUser();
//for the purpose of this test, we need to create some records with fake campaign and prospect list data,
//however we do need to create some targets for the prospect list
//create campaign tracker
$ct = new CampaignTracker();
$ct->tracker_name = 'Campaign Log Unit Test Tracker';
$ct->tracker_url = 'sugarcrm.com';
$ct->campaign_id = $this->campaign_id;
$ct->save();
$this->campaign_tracker = $ct;
//for each type, create an object and populate the campaignLog list
foreach ($this->targetObjectArray as $type) {
//skip campaign tracker
if ($type == 'CampaignTracker') {
continue;
}
//create the new bean
$bean = new $type();
if ($type == 'Account') {
$bean->name = 'CampLog Unit Test Account';
} else {
$bean->first_name = 'CampaignLog';
$bean->last_name = 'Test ' . $type;
}
$type_obj = 'target_' . $type;
$bean->save();
$this->{$type_obj} = $bean;
//save email
$sea = new SugarEmailAddress();
$id = $this->{$type_obj}->id;
$module = $this->{$type_obj}->module_dir;
$new_addrs = array();
$primary = '';
$replyTo = '';
$invalid = '';
$optOut = '';
$in_workflow = false;
$_REQUEST[$module . '_email_widget_id'] = 0;
$_REQUEST[$module . '0emailAddress0'] = $type . 'UnitTest@example.com';
$_REQUEST[$module . 'emailAddressPrimaryFlag'] = '0emailAddress0';
$_REQUEST[$module . 'emailAddressVerifiedFlag0'] = 'true';
$_REQUEST[$module . 'emailAddressVerifiedValue0'] = 'unitTest@sugarcrm.com';
$requestVariablesSet = array('0emailAddress0', 'emailAddressPrimaryFlag', 'emailAddressVerifiedFlag0', 'emailAddressVerifiedValue0');
$sea->save($id, $module, $new_addrs, $primary, $replyTo, $invalid, $optOut, $in_workflow);
//unset email request values for next run
foreach ($requestVariablesSet as $k) {
unset($_REQUEST[$k]);
}
//now create the campaign log
$cl = new CampaignLog();
$cl->campaign_id = $this->campaign_id;
$cl->tracker_key = $ct->tracker_key;
$cl->target_id = $bean->id;
$cl->target_type = $bean->module_dir;
$cl->activity_type = 'targeted';
//options are targeted (user was sent an email), link (user clicked on link), removed (user opted out) and viewed (viewed)
$cl->activity_date = date('Y-m-d H:i:s');
$cl->related_id = 'somebogusemailid' . date('His');
// this means link will not really work, but we are not testing email
$cl->related_type = 'Emails';
$cl->list_id = $this->prospect_list_id;
$cl->marketing_id = $this->email_marketing_id;
$cl->save();
}
//keep last created campaign log bean to be used to call functions
$this->campaign_log = $cl;
}
示例3: save
function save($id = '', $module = '', $new_addrs = array(), $primary = '', $replyTo = '', $invalid = '', $optOut = '', $in_workflow = false)
{
parent::save($id, $module, $new_addrs, $primary, $replyTo, $invalid, $optOut, $in_workflow);
}