本文整理匯總了PHP中CRM_Mailing_DAO_Mailing::copyValues方法的典型用法代碼示例。如果您正苦於以下問題:PHP CRM_Mailing_DAO_Mailing::copyValues方法的具體用法?PHP CRM_Mailing_DAO_Mailing::copyValues怎麽用?PHP CRM_Mailing_DAO_Mailing::copyValues使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CRM_Mailing_DAO_Mailing
的用法示例。
在下文中一共展示了CRM_Mailing_DAO_Mailing::copyValues方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: add
/**
* function to add the mailings
*
* @param array $params reference array contains the values submitted by the form
* @param array $ids reference array contains the id
*
* @access public
* @static
*
* @return object
*/
static function add(&$params, $ids = array())
{
$id = CRM_Utils_Array::value('mailing_id', $ids, CRM_Utils_Array::value('id', $params));
if ($id) {
CRM_Utils_Hook::pre('edit', 'Mailing', $id, $params);
} else {
CRM_Utils_Hook::pre('create', 'Mailing', NULL, $params);
}
$mailing = new CRM_Mailing_DAO_Mailing();
$mailing->id = $id;
$mailing->domain_id = CRM_Utils_Array::value('domain_id', $params, CRM_Core_Config::domainID());
if (!isset($params['replyto_email']) && isset($params['from_email'])) {
$params['replyto_email'] = $params['from_email'];
}
$mailing->copyValues($params);
$result = $mailing->save();
if (CRM_Utils_Array::value('mailing', $ids)) {
CRM_Utils_Hook::post('edit', 'Mailing', $mailing->id, $mailing);
} else {
CRM_Utils_Hook::post('create', 'Mailing', $mailing->id, $mailing);
}
return $result;
}
示例2: add
/**
* function to add the mailings
*
* @param array $params reference array contains the values submitted by the form
* @param array $ids reference array contains the id
*
* @access public
* @static
* @return object
*/
static function add(&$params, &$ids)
{
require_once 'CRM/Utils/Hook.php';
if (CRM_Utils_Array::value('mailing', $ids)) {
CRM_Utils_Hook::pre('edit', 'Mailing', $ids['mailing_id'], $params);
} else {
CRM_Utils_Hook::pre('create', 'Mailing', null, $params);
}
$mailing = new CRM_Mailing_DAO_Mailing();
$mailing->id = CRM_Utils_Array::value('mailing_id', $ids);
if (!isset($params['replyto_email']) && isset($params['from_email'])) {
$params['replyto_email'] = $params['from_email'];
}
$mailing->copyValues($params);
$result = $mailing->save();
if (CRM_Utils_Array::value('mailing', $ids)) {
CRM_Utils_Hook::post('edit', 'Mailing', $mailing->id, $mailing);
} else {
CRM_Utils_Hook::post('create', 'Mailing', $mailing->id, $mailing);
}
return $result;
}