当前位置: 首页>>代码示例>>PHP>>正文


PHP CRM_Core_BAO_CustomValue::getContributionValues方法代码示例

本文整理汇总了PHP中CRM_Core_BAO_CustomValue::getContributionValues方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Core_BAO_CustomValue::getContributionValues方法的具体用法?PHP CRM_Core_BAO_CustomValue::getContributionValues怎么用?PHP CRM_Core_BAO_CustomValue::getContributionValues使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CRM_Core_BAO_CustomValue的用法示例。


在下文中一共展示了CRM_Core_BAO_CustomValue::getContributionValues方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _crm_initialize

/**
 * Get an existing contribution.
 *
 * Returns a single existing Contribution object which matches ALL property
 * values passed in $params. An error object is returned if there is
 * no match, or more than one match. This API can be used to retrieve
 * the CRM internal identifier (contribution_id) based on a unique property.
 * It can also be used to retrieve any desired
 * contribution properties based on a known contribution_id.
 *
 * @param array $params           Associative array of property name/value
 *                                pairs to attempt to match on.
 * @param array $returnProperties Which properties should be included in the
 *                                returned Contribution object. If NULL, the default
 *                                set of properties will be included.
 *
 * @return CRM_Contribution|CRM_Core_Error  Return the Contribution Object if found, else
 *                                Error Object
 *
 * @access public
 *
 */
function &crm_get_contribution($params, $returnProperties = null)
{
    _crm_initialize();
    // empty parameters ?
    if (empty($params)) {
        return _crm_error('$params is empty');
    }
    // correct parameter format ?
    if (!is_array($params)) {
        return _crm_error('$params is not an array');
    }
    if (!CRM_Utils_Array::value('contribution_id', $params)) {
        $returnProperties = array('trxn_id');
        $contributions = crm_contribution_search($params, $returnProperties);
        if (count($contributions) != 1) {
            return _crm_error(count($contributions) . " contributions matching input params.");
        }
        $contributionIds = array_keys($contributions);
        $params['contribution_id'] = $contributionIds[0];
    }
    $params['id'] = $params['contribution_id'];
    $ids = array();
    $contribution =& CRM_Contribute_BAO_Contribution::getValues($params, $defaults, $ids);
    if ($contribution == null || is_a($contribution, 'CRM_Core_Error') || !$contribution->id) {
        return _crm_error('Did not find contribution object for ' . $params['contribution_id']);
    }
    unset($params['id']);
    $contribution->contribution_type_object = CRM_Contribute_BAO_Contribution::getValues($params, $defaults, $ids);
    $contribution->custom_values =& CRM_Core_BAO_CustomValue::getContributionValues($contribution->id);
    return $contribution;
}
开发者ID:bhirsch,项目名称:voipdrupal-4.7-1.0,代码行数:53,代码来源:Contribution.php


注:本文中的CRM_Core_BAO_CustomValue::getContributionValues方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。