本文整理汇总了PHP中CRM_Financial_BAO_FinancialType::find方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Financial_BAO_FinancialType::find方法的具体用法?PHP CRM_Financial_BAO_FinancialType::find怎么用?PHP CRM_Financial_BAO_FinancialType::find使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Financial_BAO_FinancialType
的用法示例。
在下文中一共展示了CRM_Financial_BAO_FinancialType::find方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: userFriendlyConditionParams
/**
* Returns a user friendly text explaining the condition params
* e.g. 'Older than 65'
*
* @return string
* @access public
*/
public function userFriendlyConditionParams()
{
$financialType = new CRM_Financial_BAO_FinancialType();
$financialType->id = $this->conditionParams['financial_type_id'];
$operator = null;
if ($this->conditionParams['operator'] == 0) {
$operator = 'equals';
}
if ($this->conditionParams['operator'] == 1) {
$operator = 'is not equal to';
}
if ($financialType->find(true)) {
return 'Financial type ' . $operator . ' ' . $financialType->name;
}
return '';
}
示例2: loadRelatedObjects
/**
* Load objects relations to contribution object.
* Objects are stored in the $_relatedObjects property
* In the first instance we are just moving functionality from BASEIpn -
* @see http://issues.civicrm.org/jira/browse/CRM-9996
*
* Note that the unit test for the BaseIPN class tests this function
*
* @param array $input
* Input as delivered from Payment Processor.
* @param array $ids
* Ids as Loaded by Payment Processor.
* @param bool $required
* Is Payment processor / contribution page required.
* @param bool $loadAll
* Load all related objects - even where id not passed in? (allows API to call this).
*
* @return bool
* @throws Exception
*/
public function loadRelatedObjects(&$input, &$ids, $required = FALSE, $loadAll = FALSE)
{
if ($loadAll) {
$ids = array_merge($this->getComponentDetails($this->id), $ids);
if (empty($ids['contact']) && isset($this->contact_id)) {
$ids['contact'] = $this->contact_id;
}
}
if (empty($this->_component)) {
if (!empty($ids['event'])) {
$this->_component = 'event';
} else {
$this->_component = strtolower(CRM_Utils_Array::value('component', $input, 'contribute'));
}
}
$paymentProcessorID = CRM_Utils_Array::value('paymentProcessor', $ids);
$contributionType = new CRM_Financial_BAO_FinancialType();
$contributionType->id = $this->financial_type_id;
$contributionType->find(TRUE);
if (!empty($ids['contact'])) {
$this->_relatedObjects['contact'] = new CRM_Contact_BAO_Contact();
$this->_relatedObjects['contact']->id = $ids['contact'];
$this->_relatedObjects['contact']->find(TRUE);
}
$this->_relatedObjects['contributionType'] = $contributionType;
if ($this->_component == 'contribute') {
// retrieve the other optional objects first so
// stuff down the line can use this info and do things
// CRM-6056
//in any case get the memberships associated with the contribution
//because we now support multiple memberships w/ price set
// see if there are any other memberships to be considered for same contribution.
$query = "\n SELECT membership_id\n FROM civicrm_membership_payment\nWHERE contribution_id = %1 ";
$params = array(1 => array($this->id, 'Integer'));
$dao = CRM_Core_DAO::executeQuery($query, $params);
while ($dao->fetch()) {
if ($dao->membership_id) {
if (!is_array($ids['membership'])) {
$ids['membership'] = array();
}
$ids['membership'][] = $dao->membership_id;
}
}
if (array_key_exists('membership', $ids) && is_array($ids['membership'])) {
foreach ($ids['membership'] as $id) {
if (!empty($id)) {
$membership = new CRM_Member_BAO_Membership();
$membership->id = $id;
if (!$membership->find(TRUE)) {
throw new Exception("Could not find membership record: {$id}");
}
$membership->join_date = CRM_Utils_Date::isoToMysql($membership->join_date);
$membership->start_date = CRM_Utils_Date::isoToMysql($membership->start_date);
$membership->end_date = CRM_Utils_Date::isoToMysql($membership->end_date);
$this->_relatedObjects['membership'][$membership->membership_type_id] = $membership;
$membership->free();
}
}
}
if (!empty($ids['pledge_payment'])) {
foreach ($ids['pledge_payment'] as $key => $paymentID) {
if (empty($paymentID)) {
continue;
}
$payment = new CRM_Pledge_BAO_PledgePayment();
$payment->id = $paymentID;
if (!$payment->find(TRUE)) {
throw new Exception("Could not find pledge payment record: " . $paymentID);
}
$this->_relatedObjects['pledge_payment'][] = $payment;
}
}
if (!empty($ids['contributionRecur'])) {
$recur = new CRM_Contribute_BAO_ContributionRecur();
$recur->id = $ids['contributionRecur'];
if (!$recur->find(TRUE)) {
throw new Exception("Could not find recur record: " . $ids['contributionRecur']);
}
$this->_relatedObjects['contributionRecur'] =& $recur;
//get payment processor id from recur object.
//.........这里部分代码省略.........
示例3: userFriendlyConditionParams
/**
* Returns a user friendly text explaining the condition params
* e.g. 'Older than 65'
*
* @return string
* @access public
*/
public function userFriendlyConditionParams()
{
$operator = null;
$countOperator = $this->setOperator($this->conditionParams['count_operator']);
$formattedString = 'Number of contributions ' . $countOperator . ' ' . $this->conditionParams['no_of_contributions'];
if (!empty($this->conditionParams['financial_type'])) {
$financialType = new CRM_Financial_BAO_FinancialType();
$financialType->id = $this->conditionParams['financial_type'];
if ($financialType->find(true)) {
$formattedString .= ' of financial type ' . $financialType->name;
}
}
$amountOperator = $this->setOperator($this->conditionParams['amount_operator']);
$formattedString .= ' where amount ' . $amountOperator . ' ' . CRM_Utils_Money::format($this->conditionParams['amount']);
return $formattedString;
}