3 * To change this license header, choose License Headers in Project Properties.
4 * To change this template file, choose Tools | Templates
5 * and open the template in the editor.
9 * Description of EntityApplyChangesTo
13 class CRM_Core_Page_AJAX_RecurringEntity
{
15 public static function updateMode() {
17 if (!empty($_REQUEST['mode']) && !empty($_REQUEST['entityId']) && !empty($_REQUEST['entityTable'])) {
18 $mode = CRM_Utils_Type
::escape($_REQUEST['mode'], 'Integer');
19 $entityId = CRM_Utils_Type
::escape($_REQUEST['entityId'], 'Integer');
20 $entityTable = CRM_Utils_Type
::escape($_REQUEST['entityTable'], 'String');
21 $priceSet = CRM_Utils_Type
::escape($_REQUEST['priceSet'], 'String');
24 // Retrieving existing priceset if price set id is not passed
25 if ($priceSet == "") {
26 $priceSetEntity = new CRM_Price_DAO_PriceSetEntity();
27 $priceSetEntity->entity_id
= $entityId;
28 $priceSetEntity->entity_table
= $entityTable;
29 $priceSetEntity->find(TRUE);
30 $priceSet = $priceSetEntity->price_set_id
;
32 $linkedEntityTable = $_REQUEST['linkedEntityTable'];
33 $finalResult = CRM_Core_BAO_RecurringEntity
::updateModeAndPriceSet($entityId, $entityTable, $mode, $linkedEntityTable, $priceSet);
35 CRM_Utils_JSON
::output($finalResult);