Fix PHP notice
[civicrm-core.git] / CRM / Contribute / Page / AJAX.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
5 | |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
10 */
11
12 /**
13 *
14 * @package CRM
15 * @copyright CiviCRM LLC https://civicrm.org/licensing
16 */
17
18 /**
19 * This class contains all the function that are called using AJAX (jQuery)
20 */
21 class CRM_Contribute_Page_AJAX {
22
23 /**
24 * Get Soft credit to list in DT
25 */
26 public static function getSoftContributionRows() {
27 $requiredParameters = [
28 'cid' => 'Integer',
29 'context' => 'String',
30 ];
31 $optionalParameters = [
32 'entityID' => 'Integer',
33 'isTest' => 'Integer',
34 ];
35
36 $params = CRM_Core_Page_AJAX::defaultSortAndPagerParams();
37 $params += CRM_Core_Page_AJAX::validateParams($requiredParameters, $optionalParameters);
38
39 $softCreditList = CRM_Contribute_BAO_ContributionSoft::getSoftContributionSelector($params);
40 CRM_Utils_JSON::output($softCreditList);
41 }
42
43 }