本文整理汇总了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;
}