本文整理汇总了PHP中CRM_Contribute_BAO_ContributionRecur::calculateRecurLineItems方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Contribute_BAO_ContributionRecur::calculateRecurLineItems方法的具体用法?PHP CRM_Contribute_BAO_ContributionRecur::calculateRecurLineItems怎么用?PHP CRM_Contribute_BAO_ContributionRecur::calculateRecurLineItems使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Contribute_BAO_ContributionRecur
的用法示例。
在下文中一共展示了CRM_Contribute_BAO_ContributionRecur::calculateRecurLineItems方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getTemplateContribution
/**
* Get the contribution to be used as the template for later contributions.
*
* Later we might merge in data stored against the contribution recur record rather than just return the contribution.
*
* @param int $id
* @param array $overrides
* Parameters that should be overriden. Add unit tests if using parameters other than total_amount & financial_type_id.
*
* @return array
* @throws \CiviCRM_API3_Exception
*/
public static function getTemplateContribution($id, $overrides = array())
{
$templateContribution = civicrm_api3('Contribution', 'get', array('contribution_recur_id' => $id, 'options' => array('limit' => 1, 'sort' => array('id DESC')), 'sequential' => 1, 'contribution_test' => ''));
if ($templateContribution['count']) {
$result = array_merge($templateContribution['values'][0], $overrides);
$result['line_item'] = CRM_Contribute_BAO_ContributionRecur::calculateRecurLineItems($id, $result['total_amount'], $result['financial_type_id']);
return $result;
}
return array();
}