本文整理汇总了PHP中CRM_Event_DAO_Event::copyValues方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Event_DAO_Event::copyValues方法的具体用法?PHP CRM_Event_DAO_Event::copyValues怎么用?PHP CRM_Event_DAO_Event::copyValues使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Event_DAO_Event
的用法示例。
在下文中一共展示了CRM_Event_DAO_Event::copyValues方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: retrieve
/**
* Takes a bunch of params that are needed to match certain criteria and
* retrieves the relevant objects. Typically the valid params are only
* contact_id. We'll tweak this function to be more full featured over a period
* of time. This is the inverse function of create. It also stores all the retrieved
* values in the default array
*
* @param array $params (reference ) an assoc array of name/value pairs
* @param array $defaults (reference ) an assoc array to hold the flattened values
*
* @return object CRM_Event_BAO_ManageEvent object
* @access public
* @static
*/
static function retrieve(&$params, &$defaults)
{
$event = new CRM_Event_DAO_Event();
$event->copyValues($params);
if ($event->find(true)) {
CRM_Core_DAO::storeValues($event, $defaults);
return $event;
}
return null;
}
示例2: add
/**
* function to add the event
*
* @param array $params reference array contains the values submitted by the form
*
* @access public
* @static
* @return object
*/
static function add(&$params)
{
require_once 'CRM/Utils/System.php';
CRM_Utils_System::flushCache();
require_once 'CRM/Utils/Hook.php';
if (CRM_Utils_Array::value('id', $params)) {
CRM_Utils_Hook::pre('edit', 'Event', $params['id'], $params);
} else {
CRM_Utils_Hook::pre('create', 'Event', null, $params);
}
$event = new CRM_Event_DAO_Event();
$event->copyValues($params);
$result = $event->save();
if (CRM_Utils_Array::value('id', $params)) {
CRM_Utils_Hook::post('edit', 'Event', $event->id, $event);
} else {
CRM_Utils_Hook::post('create', 'Event', $event->id, $event);
}
return $result;
}
示例3: add
/**
* function to add the event
*
* @param array $params reference array contains the values submitted by the form
*
* @access public
* @static
*
* @return object
*/
static function add(&$params)
{
CRM_Utils_System::flushCache();
$financialTypeId = NULL;
if (!empty($params['id'])) {
CRM_Utils_Hook::pre('edit', 'Event', $params['id'], $params);
if (empty($params['skipFinancialType'])) {
$financialTypeId = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Event', $params['id'], 'financial_type_id');
}
} else {
CRM_Utils_Hook::pre('create', 'Event', NULL, $params);
}
$event = new CRM_Event_DAO_Event();
$event->copyValues($params);
$result = $event->save();
if (!empty($params['id'])) {
CRM_Utils_Hook::post('edit', 'Event', $event->id, $event);
} else {
CRM_Utils_Hook::post('create', 'Event', $event->id, $event);
}
if ($financialTypeId && !empty($params['financial_type_id']) && $financialTypeId != $params['financial_type_id']) {
CRM_Price_BAO_PriceFieldValue::updateFinancialType($params['id'], 'civicrm_event', $params['financial_type_id']);
}
return $result;
}