本文整理汇总了PHP中SugarEmailAddress::handleLegacySave方法的典型用法代码示例。如果您正苦于以下问题:PHP SugarEmailAddress::handleLegacySave方法的具体用法?PHP SugarEmailAddress::handleLegacySave怎么用?PHP SugarEmailAddress::handleLegacySave使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SugarEmailAddress
的用法示例。
在下文中一共展示了SugarEmailAddress::handleLegacySave方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}