本文整理匯總了PHP中CRM_Contribute_DAO_Product::copyValues方法的典型用法代碼示例。如果您正苦於以下問題:PHP CRM_Contribute_DAO_Product::copyValues方法的具體用法?PHP CRM_Contribute_DAO_Product::copyValues怎麽用?PHP CRM_Contribute_DAO_Product::copyValues使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CRM_Contribute_DAO_Product
的用法示例。
在下文中一共展示了CRM_Contribute_DAO_Product::copyValues方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: retrieve
/**
* Fetch object based on array of properties.
*
* @param array $params
* (reference ) an assoc array of name/value pairs.
* @param array $defaults
* (reference ) an assoc array to hold the flattened values.
*
* @return CRM_Contribute_DAO_Product
*/
public static function retrieve(&$params, &$defaults)
{
$premium = new CRM_Contribute_DAO_Product();
$premium->copyValues($params);
if ($premium->find(TRUE)) {
CRM_Core_DAO::storeValues($premium, $defaults);
return $premium;
}
return NULL;
}
示例2: add
/**
* function to add the contribution types
*
* @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)
{
$params['is_active'] = CRM_Utils_Array::value('is_active', $params, FALSE);
$params['is_deductible'] = CRM_Utils_Array::value('is_deductible', $params, FALSE);
// action is taken depending upon the mode
$premium = new CRM_Contribute_DAO_Product();
$premium->copyValues($params);
$premium->id = CRM_Utils_Array::value('premium', $ids);
// set currency for CRM-1496
if (!isset($premium->currency)) {
$config = CRM_Core_Config::singleton();
$premium->currency = $config->defaultCurrency;
}
$premium->save();
return $premium;
}
示例3: add
/**
* add the financial types.
*
* @param array $params
* Reference array contains the values submitted by the form.
* @param array $ids
* Reference array contains the id.
*
*
* @return object
*/
public static function add(&$params, &$ids)
{
// CRM-14283 - strip protocol and domain from image URLs
$image_type = array('image', 'thumbnail');
foreach ($image_type as $key) {
if (isset($params[$key])) {
$parsedURL = explode('/', $params[$key]);
$pathComponents = array_slice($parsedURL, 3);
$params[$key] = '/' . implode('/', $pathComponents);
}
}
$params['is_active'] = CRM_Utils_Array::value('is_active', $params, FALSE);
$params['is_deductible'] = CRM_Utils_Array::value('is_deductible', $params, FALSE);
// action is taken depending upon the mode
$premium = new CRM_Contribute_DAO_Product();
$premium->copyValues($params);
$premium->id = CRM_Utils_Array::value('premium', $ids);
// set currency for CRM-1496
if (!isset($premium->currency)) {
$config = CRM_Core_Config::singleton();
$premium->currency = $config->defaultCurrency;
}
$premium->save();
return $premium;
}