當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CRM_Contribute_BAO_ContributionRecur::getRecurringFields方法代碼示例

本文整理匯總了PHP中CRM_Contribute_BAO_ContributionRecur::getRecurringFields方法的典型用法代碼示例。如果您正苦於以下問題:PHP CRM_Contribute_BAO_ContributionRecur::getRecurringFields方法的具體用法?PHP CRM_Contribute_BAO_ContributionRecur::getRecurringFields怎麽用?PHP CRM_Contribute_BAO_ContributionRecur::getRecurringFields使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CRM_Contribute_BAO_ContributionRecur的用法示例。


在下文中一共展示了CRM_Contribute_BAO_ContributionRecur::getRecurringFields方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: whereClauseSingle

 /**
  * Get where clause for a single value.
  *
  * @param array $values
  * @param CRM_Contact_BAO_Query $query
  */
 public static function whereClauseSingle(&$values, &$query)
 {
     list($name, $op, $value, $grouping, $wildcard) = $values;
     $quoteValue = NULL;
     $fields = array_merge(CRM_Contribute_BAO_Contribution::fields(), self::getFields());
     if (!empty($value) && !is_array($value)) {
         $quoteValue = "\"{$value}\"";
     }
     $strtolower = function_exists('mb_strtolower') ? 'mb_strtolower' : 'strtolower';
     $recurrringFields = CRM_Contribute_BAO_ContributionRecur::getRecurringFields();
     unset($recurrringFields['contribution_recur_payment_made']);
     foreach ($recurrringFields as $dateField => $dateFieldTitle) {
         if (self::buildDateWhere($values, $query, $name, $dateField, $dateFieldTitle)) {
             return;
         }
     }
     switch ($name) {
         case 'contribution_date':
         case 'contribution_date_low':
         case 'contribution_date_low_time':
         case 'contribution_date_high':
         case 'contribution_date_high_time':
             // process to / from date
             $query->dateQueryBuilder($values, 'civicrm_contribution', 'contribution_date', 'receive_date', 'Contribution Date');
             return;
         case 'contribution_amount':
         case 'contribution_amount_low':
         case 'contribution_amount_high':
             // process min/max amount
             $query->numberRangeBuilder($values, 'civicrm_contribution', 'contribution_amount', 'total_amount', 'Contribution Amount', NULL);
             return;
         case 'contribution_thankyou_date_is_not_null':
             if ($value) {
                 $op = "IS NOT NULL";
                 $query->_qill[$grouping][] = ts('Contribution Thank-you Sent');
             } else {
                 $op = "IS NULL";
                 $query->_qill[$grouping][] = ts('Contribution Thank-you Not Sent');
             }
             $query->_where[$grouping][] = CRM_Contact_BAO_Query::buildClause("civicrm_contribution.thankyou_date", $op);
             $query->_tables['civicrm_contribution'] = $query->_whereTables['civicrm_contribution'] = 1;
             return;
         case 'contribution_receipt_date_is_not_null':
             if ($value) {
                 $op = "IS NOT NULL";
                 $query->_qill[$grouping][] = ts('Contribution Receipt Sent');
             } else {
                 $op = "IS NULL";
                 $query->_qill[$grouping][] = ts('Contribution Receipt Not Sent');
             }
             $query->_where[$grouping][] = CRM_Contact_BAO_Query::buildClause("civicrm_contribution.receipt_date", $op);
             $query->_tables['civicrm_contribution'] = $query->_whereTables['civicrm_contribution'] = 1;
             return;
         case 'financial_type':
         case 'contribution_page':
         case 'payment_instrument':
         case 'contribution_payment_instrument':
         case 'contribution_status':
             $name .= '_id';
         case 'financial_type_id':
             CRM_Financial_BAO_FinancialType::getAvailableFinancialTypes($financialTypes);
             $query->_where[$grouping][] = CRM_Contact_BAO_Query::buildClause("civicrm_contribution.{$name}", 'IN', array_keys($financialTypes), 'String');
         case 'invoice_id':
         case 'payment_instrument_id':
         case 'contribution_payment_instrument_id':
         case 'contribution_page_id':
         case 'contribution_status_id':
         case 'contribution_id':
         case 'contribution_currency_type':
         case 'contribution_currency':
         case 'contribution_source':
         case 'contribution_trxn_id':
         case 'contribution_check_number':
         case 'contribution_contact_id':
         case strpos($name, '_amount') !== FALSE:
         case strpos($name, '_date') !== FALSE && $name != 'contribution_fulfilled_date':
         case 'contribution_campaign_id':
             $qillName = $name;
             $pseudoExtraParam = array();
             // @todo including names using a switch statement & then using an 'if' to filter them out is ... odd!
             if (strpos($name, '_amount') !== FALSE || strpos($name, '_date') !== FALSE || in_array($name, array('contribution_id', 'contribution_currency', 'contribution_source', 'contribution_trxn_id', 'contribution_check_number', 'contribution_payment_instrument_id', 'contribution_contact_id', 'contribution_campaign_id'))) {
                 $name = str_replace('contribution_', '', $name);
                 if (!in_array($name, array('source', 'id', 'contact_id', 'campaign_id'))) {
                     $qillName = str_replace('contribution_', '', $qillName);
                 }
             }
             if (in_array($name, array('contribution_currency', 'contribution_currency_type'))) {
                 $qillName = $name = 'currency';
                 $pseudoExtraParam = array('labelColumn' => 'name');
             }
             $dataType = !empty($fields[$qillName]['type']) ? CRM_Utils_Type::typeToString($fields[$qillName]['type']) : 'String';
             $query->_where[$grouping][] = CRM_Contact_BAO_Query::buildClause("civicrm_contribution.{$name}", $op, $value, $dataType);
             list($op, $value) = CRM_Contact_BAO_Query::buildQillForFieldValue('CRM_Contribute_DAO_Contribution', $name, $value, $op, $pseudoExtraParam);
             $query->_qill[$grouping][] = ts('%1 %2 %3', array(1 => $fields[$qillName]['title'], 2 => $op, 3 => $value));
//.........這裏部分代碼省略.........
開發者ID:agileware,項目名稱:civicrm-core,代碼行數:101,代碼來源:Query.php


注:本文中的CRM_Contribute_BAO_ContributionRecur::getRecurringFields方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。