From 91582553b4aa3acbf67eb6f37fafd62d3c069613 Mon Sep 17 00:00:00 2001 From: Muhammad Shahrukh <> Date: Mon, 2 Sep 2024 13:19:37 +0500 Subject: [PATCH] COMCL-793: Fix core class usages --- CRM/Lineitemedit/Util.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/CRM/Lineitemedit/Util.php b/CRM/Lineitemedit/Util.php index ea1c146..7e40b2d 100644 --- a/CRM/Lineitemedit/Util.php +++ b/CRM/Lineitemedit/Util.php @@ -1060,31 +1060,31 @@ private static function updateToFirstActiveFinancialType(int $priceSetId, array return; } if (empty($priceFieldIds)) { - $priceFieldIds = array_values(Civi\api4\PriceField::get(FALSE) + $priceFieldIds = array_values(Civi\Api4\PriceField::get(FALSE) ->addSelect('id') ->addWhere('price_set_id', '=', $priceSetId) ->execute() ->column('id')); } - $activeFinancialType = Civi\api4\FinancialType::get(FALSE) + $activeFinancialType = Civi\Api4\FinancialType::get(FALSE) ->addSelect('id') ->addWhere('is_active', '=', TRUE) ->execute() ->first(); - Civi\api4\PriceSet::update(FALSE) + Civi\Api4\PriceSet::update(FALSE) ->addValue('financial_type_id', $activeFinancialType['id']) ->addWhere('id', '=', $priceSetId) ->execute(); - Civi\api4\PriceFieldValue::update(FALSE) + Civi\Api4\PriceFieldValue::update(FALSE) ->addValue('financial_type_id', $activeFinancialType['id']) ->addWhere('price_field_id', 'IN', $priceFieldIds) ->execute(); } private static function getDefaultPriceSet(): array { - return Civi\api4\PriceSet::get(FALSE) + return Civi\Api4\PriceSet::get(FALSE) ->addSelect('priceset.id', 'financialtype.is_active') ->addWhere('name', '=', 'default_contribution_amount') ->addJoin('FinancialType', 'LEFT', NULL, ['financial_type_id', '=', 'financialtype.id'])