本文整理匯總了PHP中SugarEmailAddress::saveForBean方法的典型用法代碼示例。如果您正苦於以下問題:PHP SugarEmailAddress::saveForBean方法的具體用法?PHP SugarEmailAddress::saveForBean怎麽用?PHP SugarEmailAddress::saveForBean使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類SugarEmailAddress
的用法示例。
在下文中一共展示了SugarEmailAddress::saveForBean方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: save
/**
* @see parent::save()
*
* @param bool $check_notify
*
* @return string
*/
public function save($check_notify = false)
{
if (!empty($GLOBALS['resavingRelatedBeans'])) {
return parent::save($check_notify);
}
$this->add_address_streets('billing_address_street');
$this->add_address_streets('shipping_address_street');
$ori_in_workflow = empty($this->in_workflow) ? false : true;
$this->emailAddress->handleLegacySave($this, $this->module_dir);
$record_id = parent::save($check_notify);
$override_email = [];
if (!empty($this->email1_set_in_workflow)) {
$override_email['emailAddress0'] = $this->email1_set_in_workflow;
}
if (!empty($this->email2_set_in_workflow)) {
$override_email['emailAddress1'] = $this->email2_set_in_workflow;
}
if (!isset($this->in_workflow)) {
$this->in_workflow = false;
}
if ($ori_in_workflow === false || !empty($override_email)) {
$this->emailAddress->saveForBean($this->id, $this->module_dir, $override_email, '', '', '', '', $this->in_workflow);
}
return $record_id;
}
示例2: save
/**
* @see parent::save()
*
* @param bool $check_notify
*
* @return string
*/
public function save($check_notify = false)
{
//If we are saving due to relationship changes, don't bother trying to update the emails
if (!empty($GLOBALS['resavingRelatedBeans'])) {
parent::save($check_notify);
return $this->id;
}
$this->add_address_streets('primary_address_street');
$this->add_address_streets('alt_address_street');
$ori_in_workflow = empty($this->in_workflow) ? false : true;
$this->emailAddress->handleLegacySave($this, $this->module_dir);
// bug #39188 - store emails state before workflow make any changes
$this->emailAddress->stash($this->id, $this->module_dir);
parent::save($check_notify);
// $this->emailAddress->evaluateWorkflowChanges($this->id, $this->module_dir);
$override_email = [];
if (!empty($this->email1_set_in_workflow)) {
$override_email['emailAddress0'] = $this->email1_set_in_workflow;
}
if (!empty($this->email2_set_in_workflow)) {
$override_email['emailAddress1'] = $this->email2_set_in_workflow;
}
if (!isset($this->in_workflow)) {
$this->in_workflow = false;
}
if ($ori_in_workflow === false || !empty($override_email)) {
$this->emailAddress->saveForBean($this->id, $this->module_dir, $override_email, '', '', '', '', $this->in_workflow);
}
return $this->id;
}
示例3: saveForBean
/**
* @param string $id
* @param string $module
* @param array $new_addrs
* @param string $primary
* @param string $replyTo
* @param string $invalid
* @param string $optOut
* @param bool $in_workflow
*/
function saveForBean($id = '', $module = '', $new_addrs = [], $primary = '', $replyTo = '', $invalid = '', $optOut = '', $in_workflow = false)
{
if (func_num_args() > 1) {
parent::saveForBean($id, $module, $new_addrs, $primary, $replyTo, $invalid, $optOut, $in_workflow);
} else {
SugarBean::save($id);
}
}