From 5f23f53c831ca5fe73157c3fcd1610c095830329 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Thu, 15 Sep 2022 19:26:10 -0400 Subject: [PATCH] Replace CRM_Core_Exception aliases - api dir --- api/api.php | 8 +- api/v3/Activity.php | 21 +++-- api/v3/ActivityType.php | 4 +- api/v3/Attachment.php | 34 ++++---- api/v3/Batch.php | 4 +- api/v3/Case.php | 38 ++++----- api/v3/CaseType.php | 2 +- api/v3/Contact.php | 70 ++++++++-------- api/v3/Contribution.php | 28 +++---- api/v3/ContributionProduct.php | 4 +- api/v3/ContributionSoft.php | 2 +- api/v3/Country.php | 2 +- api/v3/CustomField.php | 2 +- api/v3/CustomValue.php | 11 ++- api/v3/Cxn.php | 14 ++-- api/v3/CxnApp.php | 4 +- api/v3/Dashboard.php | 4 +- api/v3/DashboardContact.php | 2 +- api/v3/Dedupe.php | 11 ++- api/v3/Domain.php | 2 +- api/v3/Email.php | 5 +- api/v3/Event.php | 1 - api/v3/Extension.php | 8 +- api/v3/File.php | 4 +- api/v3/FinancialTrxn.php | 2 +- api/v3/Generic.php | 12 +-- api/v3/Generic/Getactions.php | 2 +- api/v3/Generic/Getlist.php | 2 +- api/v3/Generic/Setvalue.php | 2 +- api/v3/Group.php | 4 +- api/v3/GroupContact.php | 8 +- api/v3/Job.php | 23 +++--- api/v3/LineItem.php | 6 +- api/v3/LocBlock.php | 5 +- api/v3/Logging.php | 8 +- api/v3/Mailing.php | 31 ++++---- api/v3/MailingAB.php | 22 +++--- api/v3/MailingComponent.php | 4 +- api/v3/MailingContact.php | 2 +- api/v3/MailingEventQueue.php | 4 +- api/v3/MailingEventSubscribe.php | 6 +- api/v3/MailingGroup.php | 4 +- api/v3/MailingJob.php | 4 +- api/v3/Membership.php | 5 +- api/v3/MembershipStatus.php | 10 +-- api/v3/MessageTemplate.php | 6 +- api/v3/OptionValue.php | 6 +- api/v3/Order.php | 18 ++--- api/v3/Participant.php | 3 +- api/v3/ParticipantStatusType.php | 4 +- api/v3/Payment.php | 9 +-- api/v3/PaymentProcessor.php | 10 +-- api/v3/Pledge.php | 2 +- api/v3/Premium.php | 4 +- api/v3/Product.php | 4 +- api/v3/Profile.php | 22 +++--- api/v3/Relationship.php | 2 +- api/v3/ReportTemplate.php | 14 ++-- api/v3/SavedSearch.php | 5 +- api/v3/Setting.php | 15 ++-- api/v3/StateProvince.php | 2 +- api/v3/System.php | 10 +-- api/v3/UFField.php | 6 +- api/v3/Website.php | 2 +- api/v3/WordReplacement.php | 2 +- .../Activity/ContactRefCustomField.ex.php | 2 +- .../Activity/ContactRefCustomFieldGet.ex.php | 2 +- api/v3/examples/Activity/Create.ex.php | 2 +- api/v3/examples/Activity/DateTimeHigh.ex.php | 2 +- api/v3/examples/Activity/DateTimeLow.ex.php | 2 +- api/v3/examples/Activity/Delete.ex.php | 2 +- api/v3/examples/Activity/Get.ex.php | 2 +- api/v3/examples/Activity/GetFields.ex.php | 2 +- .../Activity/GetTargetAndAssignee.ex.php | 2 +- .../Activity/GetTargetandAssigneeName.ex.php | 2 +- .../Activity/ReturnAssigneeContact.ex.php | 2 +- api/v3/examples/ActivityContact/Create.ex.php | 2 +- api/v3/examples/ActivityContact/Delete.ex.php | 2 +- api/v3/examples/ActivityType/Create.ex.php | 2 +- api/v3/examples/ActivityType/Get.ex.php | 2 +- api/v3/examples/Address/AddressLike.ex.php | 2 +- api/v3/examples/Address/AddressParse.ex.php | 2 +- api/v3/examples/Address/AddressSort.ex.php | 2 +- api/v3/examples/Address/Create.ex.php | 2 +- api/v3/examples/Address/Delete.ex.php | 2 +- api/v3/examples/Address/Get.ex.php | 2 +- api/v3/examples/Address/GetOptions.ex.php | 2 +- api/v3/examples/Batch/Create.ex.php | 2 +- api/v3/examples/Batch/Delete.ex.php | 2 +- api/v3/examples/Batch/Get.ex.php | 2 +- api/v3/examples/Batch/Update.ex.php | 2 +- api/v3/examples/Campaign/Create.ex.php | 2 +- api/v3/examples/Campaign/Delete.ex.php | 2 +- api/v3/examples/Campaign/Get.ex.php | 2 +- api/v3/examples/Case/Create.ex.php | 2 +- api/v3/examples/CaseContact/Create.ex.php | 2 +- api/v3/examples/CaseContact/Get.ex.php | 2 +- api/v3/examples/Constant/Get.ex.php | 2 +- .../examples/Contact/APIChainedArray.ex.php | 2 +- .../Contact/APIChainedArrayFormats.ex.php | 2 +- .../APIChainedArrayMultipleCustom.ex.php | 2 +- ...ainedArrayValuesFromSiblingFunction.ex.php | 2 +- .../examples/Contact/ChainTwoWebsites.ex.php | 2 +- .../Contact/ChainTwoWebsitesSyntax2.ex.php | 2 +- .../ContactIDOfLoggedInUserContactAPI.ex.php | 2 +- api/v3/examples/Contact/Create.ex.php | 2 +- .../Contact/CreateParticipantPayment.ex.php | 2 +- api/v3/examples/Contact/CustomFieldGet.ex.php | 2 +- ...CustomFieldGetReturnSyntaxVariation.ex.php | 2 +- api/v3/examples/Contact/Delete.ex.php | 2 +- .../Contact/FormatIsSuccess_Fail.ex.php | 2 +- .../Contact/FormatIsSuccess_True.ex.php | 2 +- api/v3/examples/Contact/FormatOnlyID.ex.php | 2 +- .../examples/Contact/FormatSingleValue.ex.php | 2 +- api/v3/examples/Contact/Get.ex.php | 2 +- api/v3/examples/Contact/GetActions.ex.php | 2 +- .../examples/Contact/GetCountContact.ex.php | 2 +- .../examples/Contact/GetFieldsOptions.ex.php | 2 +- api/v3/examples/Contact/GetMergedfrom.ex.php | 2 +- api/v3/examples/Contact/GetMergedto.ex.php | 2 +- api/v3/examples/Contact/GetOptions.ex.php | 2 +- .../examples/Contact/GetSingleContact.ex.php | 2 +- api/v3/examples/Contact/GetUnique.ex.php | 2 +- .../Contact/GroupFilterUsingContactAPI.ex.php | 2 +- .../Contact/NestedReplaceEmail.ex.php | 2 +- ...ontributionCreateWithHonoreeContact.ex.php | 2 +- .../ContributionCreateWithNote.ex.php | 2 +- .../ContributionCreateWithSoftCredit.ex.php | 2 +- ...ibutionCreateWithSoftCreditDefaults.ex.php | 2 +- api/v3/examples/Contribution/Create.ex.php | 2 +- .../CreateWithNestedLineItems.ex.php | 2 +- api/v3/examples/Contribution/Delete.ex.php | 2 +- api/v3/examples/Contribution/Get.ex.php | 2 +- api/v3/examples/Contribution/GetUnique.ex.php | 2 +- .../examples/ContributionPage/Create.ex.php | 2 +- .../examples/ContributionPage/Delete.ex.php | 2 +- api/v3/examples/ContributionPage/Get.ex.php | 2 +- .../examples/ContributionPage/Submit.ex.php | 2 +- .../examples/ContributionRecur/Create.ex.php | 2 +- .../examples/ContributionRecur/Delete.ex.php | 2 +- api/v3/examples/ContributionRecur/Get.ex.php | 2 +- .../examples/ContributionSoft/Create.ex.php | 2 +- .../examples/ContributionSoft/Delete.ex.php | 2 +- api/v3/examples/ContributionSoft/Get.ex.php | 2 +- api/v3/examples/Country/Create.ex.php | 2 +- api/v3/examples/Country/Delete.ex.php | 2 +- api/v3/examples/Country/Get.ex.php | 2 +- api/v3/examples/CustomField/Create.ex.php | 2 +- api/v3/examples/CustomField/Delete.ex.php | 2 +- api/v3/examples/CustomGroup/Create.ex.php | 2 +- api/v3/examples/CustomGroup/Delete.ex.php | 2 +- api/v3/examples/CustomGroup/Get.ex.php | 2 +- api/v3/examples/CustomValue/Create.ex.php | 2 +- .../CustomValue/FormatFieldName.ex.php | 2 +- api/v3/examples/CustomValue/Get.ex.php | 2 +- api/v3/examples/Domain/Create.ex.php | 2 +- api/v3/examples/Domain/Get.ex.php | 2 +- api/v3/examples/Email/Create.ex.php | 2 +- api/v3/examples/Email/Delete.ex.php | 2 +- api/v3/examples/Email/Replace.ex.php | 2 +- api/v3/examples/EntityBatch/Create.ex.php | 2 +- api/v3/examples/EntityBatch/Delete.ex.php | 2 +- api/v3/examples/EntityBatch/Get.ex.php | 2 +- api/v3/examples/EntityTag/Create.ex.php | 2 +- api/v3/examples/EntityTag/Delete.ex.php | 2 +- api/v3/examples/EntityTag/Get.ex.php | 2 +- .../Event/ContactRefCustomField.ex.php | 2 +- api/v3/examples/Event/Create.ex.php | 2 +- api/v3/examples/Event/Delete.ex.php | 2 +- api/v3/examples/Event/Get.ex.php | 2 +- api/v3/examples/Event/IsCurrentOption.ex.php | 2 +- api/v3/examples/Event/IsFullOption.ex.php | 2 +- api/v3/examples/Grant/Create.ex.php | 2 +- api/v3/examples/Grant/Delete.ex.php | 2 +- api/v3/examples/Grant/Get.ex.php | 2 +- api/v3/examples/Group/Get.ex.php | 2 +- api/v3/examples/Group/GetFields.ex.php | 2 +- api/v3/examples/GroupContact/Create.ex.php | 2 +- api/v3/examples/GroupContact/Delete.ex.php | 2 +- api/v3/examples/GroupContact/Get.ex.php | 2 +- .../GroupContact/GetWithGroupID.ex.php | 2 +- api/v3/examples/GroupNesting/Create.ex.php | 2 +- api/v3/examples/GroupNesting/Delete.ex.php | 2 +- api/v3/examples/GroupNesting/Get.ex.php | 2 +- .../examples/GroupOrganization/Create.ex.php | 2 +- .../examples/GroupOrganization/Delete.ex.php | 2 +- api/v3/examples/GroupOrganization/Get.ex.php | 2 +- api/v3/examples/Im/Create.ex.php | 2 +- api/v3/examples/Im/Delete.ex.php | 2 +- api/v3/examples/Im/Get.ex.php | 2 +- api/v3/examples/Job/Clone.ex.php | 2 +- api/v3/examples/Job/Create.ex.php | 2 +- api/v3/examples/Job/Delete.ex.php | 2 +- api/v3/examples/LineItem/Create.ex.php | 2 +- api/v3/examples/LineItem/Delete.ex.php | 2 +- api/v3/examples/LineItem/Get.ex.php | 2 +- api/v3/examples/LocBlock/Create.ex.php | 2 +- .../examples/LocBlock/CreateEntities.ex.php | 2 +- api/v3/examples/LocBlock/Get.ex.php | 2 +- api/v3/examples/Logging/Get.ex.php | 2 +- api/v3/examples/Logging/Revert.ex.php | 2 +- .../MailSettings/ChainedGetDelete.ex.php | 2 +- api/v3/examples/MailSettings/Create.ex.php | 2 +- api/v3/examples/MailSettings/Delete.ex.php | 2 +- api/v3/examples/MailSettings/Get.ex.php | 2 +- .../examples/MailSettings/GetOptions.ex.php | 2 +- api/v3/examples/Mailing/Clone.ex.php | 2 +- api/v3/examples/Mailing/Create.ex.php | 2 +- api/v3/examples/Mailing/Delete.ex.php | 2 +- api/v3/examples/Mailing/GetTokens.ex.php | 2 +- api/v3/examples/Mailing/Submit.ex.php | 2 +- api/v3/examples/MailingAB/Create.ex.php | 2 +- .../MailingEventSubscribe/Create.ex.php | 2 +- api/v3/examples/MailingGroup/Subscribe.ex.php | 2 +- api/v3/examples/Mapping/Create.ex.php | 2 +- api/v3/examples/Mapping/Delete.ex.php | 2 +- api/v3/examples/Mapping/Get.ex.php | 2 +- api/v3/examples/MappingField/Create.ex.php | 2 +- api/v3/examples/MappingField/Delete.ex.php | 2 +- api/v3/examples/MappingField/Get.ex.php | 2 +- api/v3/examples/Membership/Create.ex.php | 2 +- .../Membership/CreateWithCustomData.ex.php | 2 +- api/v3/examples/Membership/Delete.ex.php | 2 +- .../Membership/FilterIsCurrent.ex.php | 2 +- api/v3/examples/Membership/Get.ex.php | 2 +- .../Membership/SearchWithCustomData.ex.php | 2 +- .../Membership/UpdateCustomData.ex.php | 2 +- .../examples/MembershipPayment/Create.ex.php | 2 +- api/v3/examples/MembershipPayment/Get.ex.php | 2 +- .../examples/MembershipStatus/Create.ex.php | 2 +- api/v3/examples/MembershipStatus/Get.ex.php | 2 +- api/v3/examples/MembershipType/Create.ex.php | 2 +- api/v3/examples/MembershipType/Delete.ex.php | 2 +- api/v3/examples/MembershipType/Get.ex.php | 2 +- api/v3/examples/MessageTemplate/Create.ex.php | 2 +- api/v3/examples/MessageTemplate/Delete.ex.php | 2 +- api/v3/examples/MessageTemplate/Get.ex.php | 2 +- api/v3/examples/Note/Create.ex.php | 2 +- api/v3/examples/Note/Delete.ex.php | 2 +- api/v3/examples/Note/Get.ex.php | 2 +- api/v3/examples/OpenID/Create.ex.php | 2 +- api/v3/examples/OpenID/Delete.ex.php | 2 +- api/v3/examples/OpenID/Get.ex.php | 2 +- api/v3/examples/OptionGroup/Create.ex.php | 2 +- api/v3/examples/OptionGroup/Delete.ex.php | 2 +- api/v3/examples/OptionGroup/Get.ex.php | 2 +- api/v3/examples/OptionValue/Get.ex.php | 2 +- api/v3/examples/OptionValue/SortOption.ex.php | 2 +- api/v3/examples/Order/Cancel.ex.php | 2 +- api/v3/examples/Order/Create.ex.php | 2 +- .../Order/CreateOrderParticipant.ex.php | 2 +- api/v3/examples/Order/Delete.ex.php | 2 +- api/v3/examples/Order/Get.ex.php | 2 +- api/v3/examples/Participant/Create.ex.php | 2 +- api/v3/examples/Participant/Get.ex.php | 2 +- .../examples/Participant/NestedDelete.ex.php | 2 +- .../Participant/NestedEventGet.ex.php | 2 +- .../examples/ParticipantPayment/Create.ex.php | 2 +- .../examples/ParticipantPayment/Delete.ex.php | 2 +- api/v3/examples/ParticipantPayment/Get.ex.php | 2 +- .../ParticipantStatusType/Create.ex.php | 2 +- .../ParticipantStatusType/Delete.ex.php | 2 +- .../examples/ParticipantStatusType/Get.ex.php | 2 +- api/v3/examples/Payment/Cancel.ex.php | 2 +- api/v3/examples/Payment/Create.ex.php | 2 +- .../Payment/CreatePaymentWithLineItems.ex.php | 2 +- api/v3/examples/Payment/Delete.ex.php | 2 +- api/v3/examples/Payment/Get.ex.php | 2 +- api/v3/examples/Payment/UpdatePayment.ex.php | 2 +- .../examples/PaymentProcessor/Create.ex.php | 2 +- .../examples/PaymentProcessor/Delete.ex.php | 2 +- .../PaymentProcessorType/Create.ex.php | 2 +- .../PaymentProcessorType/Delete.ex.php | 2 +- api/v3/examples/PaymentToken/Create.ex.php | 2 +- api/v3/examples/PaymentToken/Delete.ex.php | 2 +- api/v3/examples/PaymentToken/Get.ex.php | 2 +- api/v3/examples/Pcp/ChainedGetDelete.ex.php | 2 +- api/v3/examples/Pcp/Create.ex.php | 2 +- api/v3/examples/Pcp/Delete.ex.php | 2 +- api/v3/examples/Pcp/Get.ex.php | 2 +- api/v3/examples/Phone/Create.ex.php | 2 +- api/v3/examples/Phone/Delete.ex.php | 2 +- api/v3/examples/Phone/Get.ex.php | 2 +- api/v3/examples/Phone/GetOptions.ex.php | 2 +- api/v3/examples/Pledge/Create.ex.php | 2 +- api/v3/examples/Pledge/Delete.ex.php | 2 +- api/v3/examples/Pledge/Get.ex.php | 2 +- .../examples/Pledge/GetFilterHighDate.ex.php | 2 +- api/v3/examples/PledgePayment/Create.ex.php | 2 +- api/v3/examples/PledgePayment/Delete.ex.php | 2 +- api/v3/examples/PledgePayment/Get.ex.php | 2 +- api/v3/examples/PledgePayment/Update.ex.php | 2 +- api/v3/examples/PriceField/Create.ex.php | 2 +- api/v3/examples/PriceField/Delete.ex.php | 2 +- api/v3/examples/PriceField/Get.ex.php | 2 +- api/v3/examples/PriceFieldValue/Create.ex.php | 2 +- api/v3/examples/PriceFieldValue/Delete.ex.php | 2 +- api/v3/examples/PriceFieldValue/Get.ex.php | 2 +- api/v3/examples/PriceSet/Create.ex.php | 2 +- api/v3/examples/PriceSet/Delete.ex.php | 2 +- api/v3/examples/PriceSet/Get.ex.php | 2 +- api/v3/examples/Profile/Apply.ex.php | 2 +- api/v3/examples/Profile/Get.ex.php | 2 +- api/v3/examples/Profile/GetFields.ex.php | 2 +- api/v3/examples/Profile/Submit.ex.php | 2 +- .../BetweenRelationshipType.ex.php | 2 +- api/v3/examples/Relationship/Create.ex.php | 2 +- api/v3/examples/Relationship/Delete.ex.php | 2 +- api/v3/examples/Relationship/Get.ex.php | 2 +- .../Relationship/INRelationshipType.ex.php | 2 +- .../NotBetweenRelationshipType.ex.php | 2 +- .../Relationship/NotInRelationshipType.ex.php | 2 +- .../Relationship/filterIsCurrent.ex.php | 2 +- .../examples/RelationshipType/Create.ex.php | 2 +- .../examples/RelationshipType/Delete.ex.php | 2 +- api/v3/examples/ReportTemplate/Getrows.ex.php | 2 +- .../ReportTemplate/Getstatistics.ex.php | 2 +- api/v3/examples/SavedSearch/Create.ex.php | 2 +- api/v3/examples/SavedSearch/Delete.ex.php | 2 +- api/v3/examples/SavedSearch/Get.ex.php | 2 +- api/v3/examples/Setting/Create.ex.php | 2 +- .../examples/Setting/CreateAllDomains.ex.php | 2 +- .../Setting/CreateSettingCurrentDomain.ex.php | 2 +- .../Setting/CreateSpecifiedDomains.ex.php | 2 +- api/v3/examples/Setting/Get.ex.php | 2 +- api/v3/examples/Setting/GetAllDomains.ex.php | 2 +- api/v3/examples/Setting/GetDefaults.ex.php | 2 +- api/v3/examples/Setting/GetFields.ex.php | 2 +- .../Setting/GetSettingCurrentDomain.ex.php | 2 +- .../Setting/GetSpecifiedDomains.ex.php | 2 +- api/v3/examples/Setting/GetValue.ex.php | 2 +- api/v3/examples/Setting/Revert.ex.php | 2 +- api/v3/examples/StateProvince/Create.ex.php | 2 +- api/v3/examples/StateProvince/Delete.ex.php | 2 +- api/v3/examples/StateProvince/Get.ex.php | 2 +- .../examples/StatusPreference/Create.ex.php | 2 +- .../examples/StatusPreference/Delete.ex.php | 2 +- api/v3/examples/StatusPreference/Get.ex.php | 2 +- .../examples/Survey/ChainedGetDelete.ex.php | 2 +- api/v3/examples/Survey/Create.ex.php | 2 +- api/v3/examples/Survey/Delete.ex.php | 2 +- api/v3/examples/Survey/Get.ex.php | 2 +- api/v3/examples/SurveyRespondant/Get.ex.php | 2 +- api/v3/examples/System/Flush.ex.php | 2 +- api/v3/examples/Tag/Create.ex.php | 2 +- api/v3/examples/Tag/Delete.ex.php | 2 +- api/v3/examples/Tag/Get.ex.php | 2 +- api/v3/examples/Tag/GetFields.ex.php | 2 +- api/v3/examples/Tag/GetList.ex.php | 2 +- api/v3/examples/Tag/GetReturnArray.ex.php | 2 +- .../TaxContributionPage/Create.ex.php | 2 +- .../CreateWithNestedLineItems.ex.php | 2 +- .../TaxContributionPage/Delete.ex.php | 2 +- api/v3/examples/UFField/Create.ex.php | 2 +- api/v3/examples/UFField/Delete.ex.php | 2 +- api/v3/examples/UFField/Get.ex.php | 2 +- api/v3/examples/UFField/Replace.ex.php | 2 +- api/v3/examples/UFGroup/Create.ex.php | 2 +- api/v3/examples/UFGroup/Delete.ex.php | 2 +- api/v3/examples/UFGroup/Get.ex.php | 2 +- api/v3/examples/UFJoin/Create.ex.php | 2 +- api/v3/examples/UFJoin/Get.ex.php | 2 +- api/v3/examples/UFMatch/Get.ex.php | 2 +- api/v3/examples/User/Get.ex.php | 2 +- api/v3/examples/User/GetFields.ex.php | 2 +- api/v3/examples/Website/Create.ex.php | 2 +- api/v3/examples/Website/Delete.ex.php | 2 +- api/v3/examples/Website/Get.ex.php | 2 +- api/v3/examples/Website/GetFields.ex.php | 2 +- .../examples/Website/GetWithMetadata.ex.php | 2 +- api/v3/utils.php | 79 +++++++++---------- 371 files changed, 629 insertions(+), 657 deletions(-) diff --git a/api/api.php b/api/api.php index 2a857a1db1..670e6ee5fe 100644 --- a/api/api.php +++ b/api/api.php @@ -56,7 +56,7 @@ function civicrm_api(string $entity, string $action, array $params) { * e.g. `$index = ['name' => 'title']` will return an array of strings - the 'title' field keyed by the 'name' field. * * @return \Civi\Api4\Generic\Result - * @throws \API_Exception + * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\NotImplementedException */ function civicrm_api4(string $entity, string $action, array $params = [], $index = NULL) { @@ -97,7 +97,7 @@ function civicrm_api4(string $entity, string $action, array $params = [], $index elseif (CRM_Utils_Rule::integer($index)) { $item = $result->itemAt($index); if (is_null($item)) { - throw new \API_Exception("Index $index not found in api results"); + throw new \CRM_Core_Exception("Index $index not found in api results"); } // Attempt to return a Result object if item is array, otherwise just return the item if (!is_array($item)) { @@ -123,7 +123,7 @@ function civicrm_api4(string $entity, string $action, array $params = [], $index * @param array $params * Array to be passed to function. * - * @throws CiviCRM_API3_Exception + * @throws CRM_Core_Exception * * @return array|int * Dependant on the $action @@ -132,7 +132,7 @@ function civicrm_api3(string $entity, string $action, array $params = []) { $params['version'] = 3; $result = \Civi::service('civi_api_kernel')->runSafe($entity, $action, $params); if (is_array($result) && !empty($result['is_error'])) { - throw new CiviCRM_API3_Exception($result['error_message'], CRM_Utils_Array::value('error_code', $result, 'undefined'), $result); + throw new CRM_Core_Exception($result['error_message'], CRM_Utils_Array::value('error_code', $result, 'undefined'), $result); } return $result; } diff --git a/api/v3/Activity.php b/api/v3/Activity.php index 878304bac4..6d95e7ca2a 100644 --- a/api/v3/Activity.php +++ b/api/v3/Activity.php @@ -21,7 +21,7 @@ * @param array $params * Array per getfields documentation. * - * @throws API_Exception + * @throws CRM_Core_Exception * @return array * API result array */ @@ -204,8 +204,7 @@ function _civicrm_api3_activity_get_spec(&$params) { * @return array * API result array * - * @throws \API_Exception - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ function civicrm_api3_activity_get($params) { @@ -289,7 +288,7 @@ function _civicrm_activity_get_handleSourceContactNameOrderBy(&$params, &$option * * @param array $params * @param CRM_Utils_SQL_Select $sql - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception * @throws \Exception */ function _civicrm_api3_activity_get_extraFilters(&$params, &$sql) { @@ -588,7 +587,7 @@ function _civicrm_api3_activity_fill_activity_contact_names(&$activities, $param * @param array $params * Array holding 'id' of activity to be deleted. * - * @throws API_Exception + * @throws CRM_Core_Exception * * @return array * API result array @@ -599,7 +598,7 @@ function civicrm_api3_activity_delete($params) { return civicrm_api3_create_success(1, $params, 'Activity', 'delete'); } else { - throw new API_Exception('Could not delete Activity: ' . (int) $params['id']); + throw new CRM_Core_Exception('Could not delete Activity: ' . (int) $params['id']); } } @@ -609,7 +608,7 @@ function civicrm_api3_activity_delete($params) { * @param array $params * Associated array of fields. * - * @throws API_Exception + * @throws CRM_Core_Exception * @throws Exception * @return array * array with errors @@ -625,7 +624,7 @@ function _civicrm_api3_activity_check_params(&$params) { if ($value && !CRM_Core_DAO::getFieldValue('CRM_Activity_DAO_Activity', $value, 'id') ) { - throw new API_Exception('Invalid ' . ucfirst($id) . ' Id'); + throw new CRM_Core_Exception('Invalid ' . ucfirst($id) . ' Id'); } } // this should be handled by wrapper layer & probably the api would already manage it @@ -649,21 +648,21 @@ function _civicrm_api3_activity_check_params(&$params) { throw new Exception($errorString); } elseif ($activityTypeId && ($activityTypeId != $activityTypeIdInList)) { - throw new API_Exception('Mismatch in Activity'); + throw new CRM_Core_Exception('Mismatch in Activity'); } $params['activity_type_id'] = $activityTypeIdInList; } elseif ($activityTypeId && !array_key_exists($activityTypeId, $activityTypes) ) { - throw new API_Exception('Invalid Activity Type ID'); + throw new CRM_Core_Exception('Invalid Activity Type ID'); } // check for activity duration minutes // this should be validated @ the wrapper layer not here // needs testing if (isset($params['duration_minutes']) && !is_numeric($params['duration_minutes'])) { - throw new API_Exception('Invalid Activity Duration (in minutes)'); + throw new CRM_Core_Exception('Invalid Activity Duration (in minutes)'); } return NULL; diff --git a/api/v3/ActivityType.php b/api/v3/ActivityType.php index 8bfb4ce843..774e9b3101 100644 --- a/api/v3/ActivityType.php +++ b/api/v3/ActivityType.php @@ -94,7 +94,7 @@ function _civicrm_api3_activity_type_create_spec(&$params) { * @param array $params * Array including id of activity_type to delete. * @return array API result array - * @throws API_Exception + * @throws CRM_Core_Exception * @deprecated use OptionValue api */ function civicrm_api3_activity_type_delete($params) { @@ -102,5 +102,5 @@ function civicrm_api3_activity_type_delete($params) { if ($result) { return civicrm_api3_create_success(TRUE, $params); } - throw new API_Exception("Failure to delete activity type id {$params['id']}"); + throw new CRM_Core_Exception("Failure to delete activity type id {$params['id']}"); } diff --git a/api/v3/Attachment.php b/api/v3/Attachment.php index 3ad4735192..aa408d1bf5 100644 --- a/api/v3/Attachment.php +++ b/api/v3/Attachment.php @@ -85,7 +85,7 @@ function _civicrm_api3_attachment_create_spec(&$spec) { * @param array $params * * @return array - * @throws API_Exception validation errors + * @throws CRM_Core_Exception validation errors * @see Civi\API\Subscriber\DynamicFKAuthorization */ function civicrm_api3_attachment_create($params) { @@ -104,29 +104,29 @@ function civicrm_api3_attachment_create($params) { $file['id'] = $fileDao->id = $id; if (!$fileDao->find(TRUE)) { - throw new API_Exception("Invalid ID"); + throw new CRM_Core_Exception("Invalid ID"); } $entityFileDao->file_id = $id; if (!$entityFileDao->find(TRUE)) { - throw new API_Exception("Cannot modify orphaned file"); + throw new CRM_Core_Exception("Cannot modify orphaned file"); } } if (!$id && !is_string($content) && !is_string($moveFile)) { - throw new API_Exception("Mandatory key(s) missing from params array: 'id' or 'content' or 'options.move-file'"); + throw new CRM_Core_Exception("Mandatory key(s) missing from params array: 'id' or 'content' or 'options.move-file'"); } if (!$isTrusted && $moveFile) { - throw new API_Exception("options.move-file is only supported on secure calls"); + throw new CRM_Core_Exception("options.move-file is only supported on secure calls"); } if (is_string($content) && is_string($moveFile)) { - throw new API_Exception("'content' and 'options.move-file' are mutually exclusive"); + throw new CRM_Core_Exception("'content' and 'options.move-file' are mutually exclusive"); } if ($id && !$isTrusted && isset($file['upload_date']) && $file['upload_date'] != CRM_Utils_Date::isoToMysql($fileDao->upload_date)) { - throw new API_Exception("Cannot modify upload_date" . var_export([$file['upload_date'], $fileDao->upload_date, CRM_Utils_Date::isoToMysql($fileDao->upload_date)], TRUE)); + throw new CRM_Core_Exception("Cannot modify upload_date" . var_export([$file['upload_date'], $fileDao->upload_date, CRM_Utils_Date::isoToMysql($fileDao->upload_date)], TRUE)); } if ($id && $name && $name != CRM_Utils_File::cleanFileName($fileDao->uri)) { - throw new API_Exception("Cannot modify name"); + throw new CRM_Core_Exception("Cannot modify name"); } if (!$id) { @@ -147,7 +147,7 @@ function civicrm_api3_attachment_create($params) { // CRM-17432 Do not use rename() since it will break file permissions. // Also avoid move_uploaded_file() because the API can use options.move-file. if (!copy($moveFile, $path)) { - throw new API_Exception("Cannot copy uploaded file $moveFile to $path"); + throw new CRM_Core_Exception("Cannot copy uploaded file $moveFile to $path"); } unlink($moveFile); } @@ -183,7 +183,7 @@ function _civicrm_api3_attachment_get_spec(&$spec) { * * @return array * per APIv3 - * @throws API_Exception validation errors + * @throws CRM_Core_Exception validation errors */ function civicrm_api3_attachment_get($params) { list($id, $file, $entityFile, $name, $content, $moveFile, $isTrusted, $returnContent) = _civicrm_api3_attachment_parse_params($params); @@ -216,7 +216,7 @@ function _civicrm_api3_attachment_delete_spec(&$spec) { * @param array $params * * @return array - * @throws API_Exception + * @throws CRM_Core_Exception */ function civicrm_api3_attachment_delete($params) { if (!empty($params['id'])) { @@ -226,7 +226,7 @@ function civicrm_api3_attachment_delete($params) { // ok } else { - throw new API_Exception("Mandatory key(s) missing from params array: id or entity_table+entity_table"); + throw new CRM_Core_Exception("Mandatory key(s) missing from params array: id or entity_table+entity_table"); } $config = CRM_Core_Config::singleton(); @@ -269,12 +269,12 @@ function civicrm_api3_attachment_delete($params) { * @param bool $isTrusted * * @return CRM_Core_DAO - * @throws API_Exception + * @throws CRM_Core_Exception */ function __civicrm_api3_attachment_find($params, $id, $file, $entityFile, $isTrusted) { foreach (['name', 'content', 'path', 'url'] as $unsupportedFilter) { if (!empty($params[$unsupportedFilter])) { - throw new API_Exception("Get by $unsupportedFilter is not currently supported"); + throw new CRM_Core_Exception("Get by $unsupportedFilter is not currently supported"); } } @@ -335,12 +335,12 @@ function __civicrm_api3_attachment_find($params, $id, $file, $entityFile, $isTru * - string $moveFile: the full path to a local file whose content should be loaded * - bool $isTrusted: whether we trust the requester to do sketchy things (like moving files or reassigning entities) * - bool $returnContent: whether we are expected to return the full content of the file - * @throws API_Exception validation errors + * @throws CRM_Core_Exception validation errors */ function _civicrm_api3_attachment_parse_params($params) { $id = $params['id'] ?? NULL; if ($id && !is_numeric($id)) { - throw new API_Exception("Malformed id"); + throw new CRM_Core_Exception("Malformed id"); } $file = []; @@ -365,7 +365,7 @@ function _civicrm_api3_attachment_parse_params($params) { $name = NULL; if (array_key_exists('name', $params)) { if ($params['name'] != basename($params['name']) || preg_match(':[/\\\\]:', $params['name'])) { - throw new API_Exception('Malformed name'); + throw new CRM_Core_Exception('Malformed name'); } $name = $params['name']; } diff --git a/api/v3/Batch.php b/api/v3/Batch.php index 0b68afe415..b11ee30c6b 100644 --- a/api/v3/Batch.php +++ b/api/v3/Batch.php @@ -21,7 +21,7 @@ * @param array $params * * @return array - * @throws \API_Exception + * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ function civicrm_api3_batch_create($params) { @@ -65,7 +65,7 @@ function civicrm_api3_batch_get($params) { * * @return array * Array of deleted values. - * @throws \API_Exception + * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ function civicrm_api3_batch_delete($params) { diff --git a/api/v3/Case.php b/api/v3/Case.php index 21082e6330..a4543080c1 100644 --- a/api/v3/Case.php +++ b/api/v3/Case.php @@ -40,7 +40,7 @@ * 'details' => str // html format * ``` * - * @throws API_Exception + * @throws CRM_Core_Exception * @return array * api result array */ @@ -61,7 +61,7 @@ function civicrm_api3_case_create($params) { // FIXME: Should we check if case with ID actually exists? if (array_key_exists('creator_id', $params)) { - throw new API_Exception('You cannot update creator id'); + throw new CRM_Core_Exception('You cannot update creator id'); } $mergedCaseIds = $origContactIds = []; @@ -75,10 +75,10 @@ function civicrm_api3_case_create($params) { if (count($origContactIds) > 1) { // Multiple original contact IDs. Need to specify which one to use as a parameter if (empty($params['orig_contact_id'])) { - throw new API_Exception('Case is linked with more than one contact id. Provide the required params orig_contact_id to be replaced'); + throw new CRM_Core_Exception('Case is linked with more than one contact id. Provide the required params orig_contact_id to be replaced'); } if (!empty($params['orig_contact_id']) && !in_array($params['orig_contact_id'], $origContactIds)) { - throw new API_Exception('Invalid case contact id (orig_contact_id)'); + throw new CRM_Core_Exception('Invalid case contact id (orig_contact_id)'); } $origContactId = $params['orig_contact_id']; } @@ -104,7 +104,7 @@ function civicrm_api3_case_create($params) { $caseBAO = CRM_Case_BAO_Case::create($params); if (!$caseBAO) { - throw new API_Exception('Case not created. Please check input params.'); + throw new CRM_Core_Exception('Case not created. Please check input params.'); } if (isset($params['contact_id']) && !isset($params['id'])) { @@ -255,7 +255,7 @@ function _civicrm_api3_case_delete_spec(&$params) { * $params CRM_Utils_SQL_Select $sql * Other apis wishing to wrap & extend this one can pass in a $sql object with extra clauses * - * @throws API_Exception + * @throws CRM_Core_Exception * @return array * (get mode, case_id provided): Array with case details, case roles, case activity ids, (search mode, case_id not provided): Array of cases found */ @@ -295,7 +295,7 @@ function civicrm_api3_case_get($params, $sql = NULL) { list(, $sortField) = array_pad(explode('.', $sortField), 2, 'id'); // Validate inputs if (!array_key_exists($sortField, CRM_Contact_DAO_Contact::fieldKeys()) || ($dir != 'ASC' && $dir != 'DESC')) { - throw new API_Exception("Unknown field specified for sort. Cannot order by '$contactSort'"); + throw new CRM_Core_Exception("Unknown field specified for sort. Cannot order by '$contactSort'"); } $sql->orderBy("case_contact.$sortField $dir", NULL, $index); } @@ -313,7 +313,7 @@ function civicrm_api3_case_get($params, $sql = NULL) { // Add clause to search by activity if (!empty($params['activity_id'])) { if (!CRM_Utils_Rule::positiveInteger($params['activity_id'])) { - throw new API_Exception('Invalid parameter: activity_id. Must provide a numeric value.'); + throw new CRM_Core_Exception('Invalid parameter: activity_id. Must provide a numeric value.'); } $activityId = $params['activity_id']; $originalId = CRM_Core_DAO::getFieldValue('CRM_Activity_BAO_Activity', $activityId, 'original_id'); @@ -368,7 +368,7 @@ function civicrm_api3_case_get($params, $sql = NULL) { * * @param array $params * - * @throws API_Exception + * @throws CRM_Core_Exception * @return array */ function civicrm_api3_case_activity_create($params) { @@ -383,7 +383,7 @@ function civicrm_api3_case_activity_create($params) { * * @param array $params * - * @throws API_Exception + * @throws CRM_Core_Exception * @return array */ function civicrm_api3_case_addtimeline($params) { @@ -440,7 +440,7 @@ function _civicrm_api3_case_addtimeline_spec(&$params) { * * @param array $params * - * @throws API_Exception + * @throws CRM_Core_Exception * @return array */ function civicrm_api3_case_merge($params) { @@ -494,7 +494,7 @@ function _civicrm_api3_case_deprecation() { * 'start_date' => str datestamp * 'contact_id' => int // case client * - * @throws API_Exception + * @throws CRM_Core_Exception * @return array * api result array */ @@ -508,7 +508,7 @@ function civicrm_api3_case_update($params) { // return error if modifying creator id if (array_key_exists('creator_id', $params)) { - throw new API_Exception(ts('You cannot update creator id')); + throw new CRM_Core_Exception(ts('You cannot update creator id')); } $mCaseId = $origContactIds = []; @@ -522,10 +522,10 @@ function civicrm_api3_case_update($params) { if (count($origContactIds) > 1) { // check valid orig contact id if (!empty($params['orig_contact_id']) && !in_array($params['orig_contact_id'], $origContactIds)) { - throw new API_Exception('Invalid case contact id (orig_contact_id)'); + throw new CRM_Core_Exception('Invalid case contact id (orig_contact_id)'); } elseif (empty($params['orig_contact_id'])) { - throw new API_Exception('Case is linked with more than one contact id. Provide the required params orig_contact_id to be replaced'); + throw new CRM_Core_Exception('Case is linked with more than one contact id. Provide the required params orig_contact_id to be replaced'); } $origContactId = $params['orig_contact_id']; } @@ -564,7 +564,7 @@ function civicrm_api3_case_update($params) { * 'move_to_trash' => bool (defaults to false) * ``` * - * @throws API_Exception + * @throws CRM_Core_Exception * @return mixed */ function civicrm_api3_case_delete($params) { @@ -575,7 +575,7 @@ function civicrm_api3_case_delete($params) { return civicrm_api3_create_success($params, $params, 'Case', 'delete'); } else { - throw new API_Exception('Could not delete case.'); + throw new CRM_Core_Exception('Could not delete case.'); } } @@ -594,7 +594,7 @@ function _civicrm_api3_case_restore_spec(&$spec) { * Restore a specified case from the trash. * * @param array $params - * @throws API_Exception + * @throws CRM_Core_Exception * @return mixed */ function civicrm_api3_case_restore($params) { @@ -602,7 +602,7 @@ function civicrm_api3_case_restore($params) { return civicrm_api3_create_success($params, $params, 'Case', 'restore'); } else { - throw new API_Exception('Could not restore case.'); + throw new CRM_Core_Exception('Could not restore case.'); } } diff --git a/api/v3/CaseType.php b/api/v3/CaseType.php index 3caa7fba6d..d3c85d4cb6 100644 --- a/api/v3/CaseType.php +++ b/api/v3/CaseType.php @@ -21,7 +21,7 @@ * @param array $params * Input parameters. * - * @throws API_Exception + * @throws CRM_Core_Exception * @return array * API result array */ diff --git a/api/v3/Contact.php b/api/v3/Contact.php index eb54fc665c..36d40f277e 100644 --- a/api/v3/Contact.php +++ b/api/v3/Contact.php @@ -30,8 +30,8 @@ * @return array * API Result Array * - * @throws \CiviCRM_API3_Exception - * @throws API_Exception + * @throws \CRM_Core_Exception + * @throws CRM_Core_Exception * @throws \CRM_Core_Exception */ function civicrm_api3_contact_create($params) { @@ -44,7 +44,7 @@ function civicrm_api3_contact_create($params) { if (!empty($params['dupe_check'])) { $ids = CRM_Contact_BAO_Contact::getDuplicateContacts($params, $params['contact_type'], 'Unsupervised', [], $params['check_permission']); if (count($ids) > 0) { - throw new API_Exception("Found matching contacts: " . implode(',', $ids), "duplicate", ["ids" => $ids]); + throw new CRM_Core_Exception("Found matching contacts: " . implode(',', $ids), "duplicate", ["ids" => $ids]); } } @@ -84,7 +84,7 @@ function civicrm_api3_contact_create($params) { if (empty($params['contact_type']) && $contactID) { $params['contact_type'] = CRM_Contact_BAO_Contact::getContactType($contactID); if (!$params['contact_type']) { - throw new API_Exception('Contact id ' . $contactID . ' not found.'); + throw new CRM_Core_Exception('Contact id ' . $contactID . ' not found.'); } } @@ -99,7 +99,7 @@ function civicrm_api3_contact_create($params) { $contact = _civicrm_api3_contact_update($params, $contactID); if (is_a($contact, 'CRM_Core_Error')) { - throw new API_Exception($contact->_errors[0]['message']); + throw new CRM_Core_Exception($contact->_errors[0]['message']); } else { $values = []; @@ -153,8 +153,7 @@ function _civicrm_api3_contact_create_spec(&$params) { * @return array * API Result Array * - * @throws \API_Exception - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ function civicrm_api3_contact_get($params) { $options = []; @@ -172,7 +171,7 @@ function civicrm_api3_contact_get($params) { * @param array $params * * @return int - * @throws \API_Exception + * @throws \CRM_Core_Exception */ function civicrm_api3_contact_getcount($params) { $options = []; @@ -451,7 +450,6 @@ function _civicrm_api3_contact_get_supportanomalies(&$params, &$options) { * @return array * API Result Array * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \Civi\API\Exception\UnauthorizedException */ function civicrm_api3_contact_delete($params) { @@ -462,7 +460,7 @@ function civicrm_api3_contact_delete($params) { } if ($contactID == CRM_Core_Session::getLoggedInContactID()) { - throw new API_Exception('This contact record is linked to the currently logged in user account - and cannot be deleted.'); + throw new CRM_Core_Exception('This contact record is linked to the currently logged in user account - and cannot be deleted.'); } $restore = !empty($params['restore']); $skipUndelete = !empty($params['skip_undelete']); @@ -471,13 +469,13 @@ function civicrm_api3_contact_delete($params) { // restrict permanent delete if a contact has financial trxn associated with it $error = NULL; if ($skipUndelete && CRM_Financial_BAO_FinancialItem::checkContactPresent([$contactID], $error)) { - throw new API_Exception($error['_qf_default']); + throw new CRM_Core_Exception($error['_qf_default']); } if (CRM_Contact_BAO_Contact::deleteContact($contactID, $restore, $skipUndelete, CRM_Utils_Array::value('check_permissions', $params))) { return civicrm_api3_create_success(); } - throw new CiviCRM_API3_Exception('Could not delete contact'); + throw new CRM_Core_Exception('Could not delete contact'); } /** @@ -488,8 +486,8 @@ function civicrm_api3_contact_delete($params) { * @param array $params * * @return null - * @throws API_Exception - * @throws CiviCRM_API3_Exception + * @throws CRM_Core_Exception + * @throws CRM_Core_Exception */ function _civicrm_api3_contact_check_params(&$params) { @@ -514,7 +512,7 @@ function _civicrm_api3_contact_check_params(&$params) { if (!empty($params['contact_sub_type']) && !empty($params['contact_type'])) { if (!(CRM_Contact_BAO_ContactType::isExtendsContactType($params['contact_sub_type'], $params['contact_type']))) { - throw new API_Exception("Invalid or Mismatched Contact Subtype: " . implode(', ', (array) $params['contact_sub_type'])); + throw new CRM_Core_Exception("Invalid or Mismatched Contact Subtype: " . implode(', ', (array) $params['contact_sub_type'])); } } @@ -528,12 +526,12 @@ function _civicrm_api3_contact_check_params(&$params) { // check for mismatch employer name and id if (!empty($params['employer_id']) && !in_array($params['employer_id'], $dupeIds)) { - throw new API_Exception('Employer name and Employer id Mismatch'); + throw new CRM_Core_Exception('Employer name and Employer id Mismatch'); } // show error if multiple organisation with same name exist if (empty($params['employer_id']) && (count($dupeIds) > 1)) { - throw new API_Exception('Found more than one Organisation with same Name.'); + throw new CRM_Core_Exception('Found more than one Organisation with same Name.'); } if ($dupeIds) { @@ -562,7 +560,6 @@ function _civicrm_api3_contact_check_params(&$params) { * @return CRM_Contact_BAO_Contact|CRM_Core_Error * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \Civi\API\Exception\UnauthorizedException */ function _civicrm_api3_contact_update($params, $contactID = NULL) { @@ -580,7 +577,7 @@ function _civicrm_api3_contact_update($params, $contactID = NULL) { * @param array $params * Array per getfields metadata. * - * @throws API_Exception + * @throws CRM_Core_Exception * @throws \CRM_Core_Exception */ function _civicrm_api3_greeting_format_params($params) { @@ -626,7 +623,7 @@ function _civicrm_api3_greeting_format_params($params) { if ($customGreeting && $greetingId && ($greetingId != array_search('Customized', $greetings)) ) { - throw new API_Exception(ts('Provide either %1 greeting id and/or %1 greeting or custom %1 greeting', + throw new CRM_Core_Exception(ts('Provide either %1 greeting id and/or %1 greeting or custom %1 greeting', [1 => $key] )); } @@ -634,14 +631,14 @@ function _civicrm_api3_greeting_format_params($params) { if ($greetingVal && $greetingId && ($greetingId != CRM_Utils_Array::key($greetingVal, $greetings)) ) { - throw new API_Exception(ts('Mismatch in %1 greeting id and %1 greeting', + throw new CRM_Core_Exception(ts('Mismatch in %1 greeting id and %1 greeting', [1 => $key] )); } if ($greetingId) { if (!$customGreeting && ($greetingId == array_search('Customized', $greetings))) { - throw new API_Exception(ts('Please provide a custom value for %1 greeting', + throw new CRM_Core_Exception(ts('Please provide a custom value for %1 greeting', [1 => $key] )); } @@ -649,7 +646,7 @@ function _civicrm_api3_greeting_format_params($params) { elseif ($greetingVal) { if (!in_array($greetingVal, $greetings)) { - throw new API_Exception(ts('Invalid %1 greeting', [1 => $key])); + throw new CRM_Core_Exception(ts('Invalid %1 greeting', [1 => $key])); } $greetingId = CRM_Utils_Array::key($greetingVal, $greetings); @@ -733,7 +730,7 @@ function _civicrm_api3_contact_getquick_spec(&$params) { * @param array $params * * @return array - * @throws \API_Exception + * @throws \CRM_Core_Exception */ function civicrm_api3_contact_getquick($params) { $name = CRM_Utils_Type::escape(CRM_Utils_Array::value('name', $params), 'String'); @@ -767,7 +764,7 @@ function civicrm_api3_contact_getquick($params) { $field_name = CRM_Utils_String::munge($params['field_name']); // there is no good reason to request api_key via getquick if ($field_name == 'api_key') { - throw new API_Exception('Illegal value "api_key" for parameter "field_name"'); + throw new CRM_Core_Exception('Illegal value "api_key" for parameter "field_name"'); } // Unique name contact_id = id if ($field_name == 'contact_id') { @@ -1160,8 +1157,6 @@ function _civicrm_api3_contact_deprecation() { * @return array * API Result Array * - * @throws API_Exception - * @throws \CiviCRM_API3_Exception * @throws \CRM_Core_Exception */ function civicrm_api3_contact_merge($params) { @@ -1175,7 +1170,7 @@ function civicrm_api3_contact_merge($params) { return civicrm_api3_create_success($result, $params); } - throw new API_Exception('Merge failed'); + throw new CRM_Core_Exception('Merge failed'); } /** @@ -1219,8 +1214,7 @@ function _civicrm_api3_contact_merge_spec(&$params) { * API Result Array * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception - * @throws \API_Exception + * @throws \CRM_Core_Exception */ function civicrm_api3_contact_get_merge_conflicts($params) { $migrationInfo = []; @@ -1266,7 +1260,7 @@ function _civicrm_api3_contact_get_merge_conflicts_spec(&$params) { * @return array * API Result Array * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ function civicrm_api3_contact_getmergedto($params) { $contactID = _civicrm_api3_contact_getmergedto($params); @@ -1290,7 +1284,7 @@ function civicrm_api3_contact_getmergedto($params) { * * @return int|false * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ function _civicrm_api3_contact_getmergedto($params) { $contactID = FALSE; @@ -1343,7 +1337,7 @@ function _civicrm_api3_contact_getmergedto_spec(&$params) { * @return array * API Result Array * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ function civicrm_api3_contact_getmergedfrom($params) { $contacts = _civicrm_api3_contact_getmergedfrom($params); @@ -1357,7 +1351,7 @@ function civicrm_api3_contact_getmergedfrom($params) { * * @return array * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ function _civicrm_api3_contact_getmergedfrom($params) { $activities = []; @@ -1452,7 +1446,7 @@ function civicrm_api3_contact_proximity($params) { !CRM_Utils_Rule::numeric($longitude) || !CRM_Utils_Rule::numeric($distance) ) { - throw new API_Exception(ts('Latitude, Longitude and Distance should exist and be numeric')); + throw new CRM_Core_Exception(ts('Latitude, Longitude and Distance should exist and be numeric')); } if ($unit === 'mile') { @@ -1599,14 +1593,14 @@ function _civicrm_api3_contact_getlist_output($result, $request) { * @return array * API formatted array * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ function civicrm_api3_contact_duplicatecheck($params) { if (!isset($params['match']) || !is_array($params['match'])) { - throw new \CiviCRM_API3_Exception('Duplicate check must include criteria to check against (missing or invalid $params[\'match\']).'); + throw new \CRM_Core_Exception('Duplicate check must include criteria to check against (missing or invalid $params[\'match\']).'); } if (!isset($params['match']['contact_type']) || !is_string($params['match']['contact_type'])) { - throw new \CiviCRM_API3_Exception('Duplicate check must include a contact type. (missing or invalid $params[\'match\'][\'contact_type\'])'); + throw new \CRM_Core_Exception('Duplicate check must include a contact type. (missing or invalid $params[\'match\'][\'contact_type\'])'); } $dupes = CRM_Contact_BAO_Contact::getDuplicateContacts( $params['match'], diff --git a/api/v3/Contribution.php b/api/v3/Contribution.php index 8cd09aa667..06fae12ada 100644 --- a/api/v3/Contribution.php +++ b/api/v3/Contribution.php @@ -23,7 +23,7 @@ use Civi\Api4\Contribution; * @param array $params * Input parameters. * - * @throws API_Exception + * @throws CRM_Core_Exception * @return array * Api result array */ @@ -50,7 +50,7 @@ function civicrm_api3_contribution_create($params) { ->addValue('id', $params['id'] ?? NULL) ->addValue('financial_type_id', $params['financial_type_id'] ?? NULL) ->execute()->first()['access']) { - throw new API_Exception('You do not have permission to create this contribution'); + throw new CRM_Core_Exception('You do not have permission to create this contribution'); } } if (!empty($params['id']) && !empty($params['contribution_status_id'])) { @@ -60,14 +60,14 @@ function civicrm_api3_contribution_create($params) { // action it needs to be blocked there. If it is Ok through a form it needs to be OK through the api CRM_Contribute_BAO_Contribution::checkStatusValidation(NULL, $params, $error); if (array_key_exists('contribution_status_id', $error)) { - throw new API_Exception($error['contribution_status_id']); + throw new CRM_Core_Exception($error['contribution_status_id']); } } if (!empty($params['id']) && !empty($params['financial_type_id'])) { $error = []; CRM_Contribute_BAO_Contribution::checkFinancialTypeChange($params['financial_type_id'], $params['id'], $error); if (array_key_exists('financial_type_id', $error)) { - throw new API_Exception($error['financial_type_id']); + throw new CRM_Core_Exception($error['financial_type_id']); } } if (!isset($params['tax_amount']) && empty($params['line_item']) @@ -209,18 +209,18 @@ function _civicrm_api3_contribution_create_legacy_support_45(&$params) { * Input parameters. * * @return array - * @throws \API_Exception + * @throws \CRM_Core_Exception */ function civicrm_api3_contribution_delete($params) { $contributionID = !empty($params['contribution_id']) ? $params['contribution_id'] : $params['id']; if (!empty($params['check_permissions']) && !\Civi\Api4\Utils\CoreUtil::checkAccessDelegated('Contribution', 'delete', ['id' => $contributionID], CRM_Core_Session::getLoggedInContactID() ?: 0)) { - throw new API_Exception('You do not have permission to delete this contribution'); + throw new CRM_Core_Exception('You do not have permission to delete this contribution'); } if (CRM_Contribute_BAO_Contribution::deleteContribution($contributionID)) { return civicrm_api3_create_success([$contributionID => 1]); } - throw new API_Exception('Could not delete contribution'); + throw new CRM_Core_Exception('Could not delete contribution'); } /** @@ -274,7 +274,7 @@ function civicrm_api3_contribution_get($params) { * @param array $params * * @return array - * @throws \API_Exception + * @throws \CRM_Core_Exception */ function _civicrm_api3_contribution_get_support_nonunique_returns($params) { $additionalOptions = []; @@ -472,7 +472,6 @@ function _civicrm_api3_contribution_sendconfirmation_spec(&$params) { * * @return array * API result array - * @throws \API_Exception * @throws \CRM_Core_Exception * @throws \Exception */ @@ -480,10 +479,10 @@ function civicrm_api3_contribution_completetransaction($params): array { $contribution = new CRM_Contribute_BAO_Contribution(); $contribution->id = $params['id']; if (!$contribution->find(TRUE)) { - throw new API_Exception('A valid contribution ID is required', 'invalid_data'); + throw new CRM_Core_Exception('A valid contribution ID is required', 'invalid_data'); } if ($contribution->contribution_status_id == CRM_Core_PseudoConstant::getKey('CRM_Contribute_BAO_Contribution', 'contribution_status_id', 'Completed')) { - throw new API_Exception(ts('Contribution already completed'), 'contribution_completed'); + throw new CRM_Core_Exception(ts('Contribution already completed'), 'contribution_completed'); } $params['trxn_id'] = $params['trxn_id'] ?? $contribution->trxn_id; @@ -604,7 +603,7 @@ function _civicrm_api3_contribution_completetransaction_spec(&$params) { * * @return array * Api result array. - * @throws API_Exception + * @throws CRM_Core_Exception */ function civicrm_api3_contribution_repeattransaction($params) { @@ -616,7 +615,7 @@ function civicrm_api3_contribution_repeattransaction($params) { // @todo this duplicates work done by CRM_Contribute_BAO_Contribution::repeatTransaction & should be removed. $templateContribution = CRM_Contribute_BAO_ContributionRecur::getTemplateContribution($params['contribution_recur_id']); if (empty($templateContribution)) { - throw new CiviCRM_API3_Exception('Contribution.repeattransaction failed to get original_contribution_id for recur with ID: ' . $params['contribution_recur_id']); + throw new CRM_Core_Exception('Contribution.repeattransaction failed to get original_contribution_id for recur with ID: ' . $params['contribution_recur_id']); } } else { @@ -628,7 +627,7 @@ function civicrm_api3_contribution_repeattransaction($params) { ->addWhere('contribution_recur_id', 'IS NOT EMPTY') ->execute()->first(); if (empty($templateContribution)) { - throw new CiviCRM_API3_Exception("Contribution.repeattransaction failed to load the given original_contribution_id ($params[original_contribution_id]) because it does not exist, or because it does not belong to a recurring contribution"); + throw new CRM_Core_Exception("Contribution.repeattransaction failed to load the given original_contribution_id ($params[original_contribution_id]) because it does not exist, or because it does not belong to a recurring contribution"); } } @@ -692,7 +691,6 @@ function civicrm_api3_contribution_repeattransaction($params) { * * @return mixed * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ function _ipn_process_transaction($params, $contribution, $input, $ids) { CRM_Core_Error::deprecatedFunctionWarning('API3 contribution.completetransaction or contribution.repeattransaction'); diff --git a/api/v3/ContributionProduct.php b/api/v3/ContributionProduct.php index 0a116d020b..d0afa574c5 100644 --- a/api/v3/ContributionProduct.php +++ b/api/v3/ContributionProduct.php @@ -23,7 +23,7 @@ * * @param array $params * - * @throws API_Exception + * @throws CRM_Core_Exception * @return array */ function civicrm_api3_contribution_product_create($params) { @@ -47,7 +47,7 @@ function civicrm_api3_contribution_product_get($params) { * * @param array $params * - * @throws API_Exception + * @throws CRM_Core_Exception * @return array * Array of deleted values. */ diff --git a/api/v3/ContributionSoft.php b/api/v3/ContributionSoft.php index 9a44d52670..f2c829a1fa 100644 --- a/api/v3/ContributionSoft.php +++ b/api/v3/ContributionSoft.php @@ -50,7 +50,7 @@ function _civicrm_api3_contribution_soft_create_spec(&$params) { * @return array * Api formatted result. * - * @throws API_Exception + * @throws CRM_Core_Exception */ function civicrm_api3_contribution_soft_delete($params) { return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params); diff --git a/api/v3/Country.php b/api/v3/Country.php index 38c64f4d99..fd5a54d013 100644 --- a/api/v3/Country.php +++ b/api/v3/Country.php @@ -23,7 +23,7 @@ * * @return array * API result array - * @throws \API_Exception + * @throws \CRM_Core_Exception */ function civicrm_api3_country_create($params) { return _civicrm_api3_basic_create(_civicrm_api3_get_DAO(__FUNCTION__), $params, 'Country'); diff --git a/api/v3/CustomField.php b/api/v3/CustomField.php index 7a66f733f5..4ca7cab13b 100644 --- a/api/v3/CustomField.php +++ b/api/v3/CustomField.php @@ -27,7 +27,7 @@ * * @return array * API success array - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ function civicrm_api3_custom_field_create(array $params): array { diff --git a/api/v3/CustomValue.php b/api/v3/CustomValue.php index 9efe097af7..f3b127c177 100644 --- a/api/v3/CustomValue.php +++ b/api/v3/CustomValue.php @@ -113,7 +113,7 @@ function _civicrm_api3_custom_value_create_spec(&$params) { * Example: 'entity_id' => 123, 'return.custom_6' => 1, 'return.custom_33' => 1 * If you do not know the ID, you may use group name : field name, for example 'return.foo_stuff:my_field' => 1 * - * @throws API_Exception + * @throws CRM_Core_Exception * @return array */ function civicrm_api3_custom_value_get($params) { @@ -163,7 +163,7 @@ function civicrm_api3_custom_value_get($params) { return civicrm_api3_create_success($values, $params, 'CustomValue'); } else { - throw new API_Exception($result['error_message']); + throw new CRM_Core_Exception($result['error_message']); } } else { @@ -230,7 +230,7 @@ function _civicrm_api3_custom_value_get_spec(&$params) { * * @param array $spec description of fields supported by this API call * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ function _civicrm_api3_custom_value_gettree_spec(&$spec) { $spec['entity_id'] = [ @@ -280,9 +280,8 @@ function _civicrm_api3_custom_value_gettree_spec(&$spec) { * @param array $params * * @return array API result - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ function civicrm_api3_custom_value_gettree($params) { $ret = []; @@ -412,7 +411,7 @@ function _civicrm_api3_custom_value_getdisplayvalue_spec(&$spec) { * @param array $params * * @return array API result - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ function civicrm_api3_custom_value_getdisplayvalue($params) { // Null or missing means use the current db value, but treat '0', 0, and '' as legitimate values to look up. diff --git a/api/v3/Cxn.php b/api/v3/Cxn.php index 3ad6508c98..8c81f3c394 100644 --- a/api/v3/Cxn.php +++ b/api/v3/Cxn.php @@ -55,11 +55,11 @@ function civicrm_api3_cxn_register($params) { if (!empty($params['app_meta_url'])) { list ($status, $json) = CRM_Utils_HttpClient::singleton()->get($params['app_meta_url']); if (CRM_Utils_HttpClient::STATUS_OK != $status) { - throw new API_Exception("Failed to download appMeta. (Bad HTTP response)"); + throw new CRM_Core_Exception("Failed to download appMeta. (Bad HTTP response)"); } $appMeta = json_decode($json, TRUE); if (empty($appMeta)) { - throw new API_Exception("Failed to download appMeta. (Malformed)"); + throw new CRM_Core_Exception("Failed to download appMeta. (Malformed)"); } } elseif (!empty($params['app_guid'])) { @@ -69,7 +69,7 @@ function civicrm_api3_cxn_register($params) { } if (empty($appMeta) || !is_array($appMeta)) { - throw new API_Exception("Missing expected parameter: app_guid"); + throw new CRM_Core_Exception("Missing expected parameter: app_guid"); } \Civi\Cxn\Rpc\AppMeta::validate($appMeta); @@ -134,7 +134,7 @@ function civicrm_api3_cxn_unregister($params) { * @return string * The CxnId. (If not available, then an exception is thrown.) * - * @throws API_Exception + * @throws CRM_Core_Exception */ function _civicrm_api3_cxn_parseCxnId($params) { $cxnId = NULL; @@ -147,11 +147,11 @@ function _civicrm_api3_cxn_parseCxnId($params) { 1 => [$params['app_guid'], 'String'], ]); if (!$cxnId) { - throw new API_Exception("The app_guid does not correspond to an active connection."); + throw new CRM_Core_Exception("The app_guid does not correspond to an active connection."); } } if (!$cxnId) { - throw new API_Exception('Missing required parameter: cxn_guid'); + throw new CRM_Core_Exception('Missing required parameter: cxn_guid'); } return $cxnId; } @@ -231,7 +231,7 @@ function civicrm_api3_cxn_getlink($params) { $appMeta = CRM_Cxn_BAO_Cxn::getAppMeta($cxnId); if (empty($params['page_name']) || !is_string($params['page_name'])) { - throw new API_Exception("Invalid page"); + throw new CRM_Core_Exception("Invalid page"); } /** @var \Civi\Cxn\Rpc\RegistrationClient $client */ diff --git a/api/v3/CxnApp.php b/api/v3/CxnApp.php index f087d53e04..8067d525ca 100644 --- a/api/v3/CxnApp.php +++ b/api/v3/CxnApp.php @@ -73,7 +73,7 @@ function _civicrm_api3_cxn_app_get_spec(&$spec) { * * @param array $params * @return array - * @throws API_Exception + * @throws CRM_Core_Exception * @throws CRM_Core_Exception * @throws \Civi\Cxn\Rpc\Exception\InvalidMessageException */ @@ -83,7 +83,7 @@ function civicrm_api3_cxn_app_get($params) { list ($headers, $blob, $code) = CRM_Cxn_CiviCxnHttp::singleton()->send('GET', $url, ''); if ($code != 200) { - throw new API_Exception("Failed to download application list."); + throw new CRM_Core_Exception("Failed to download application list."); } $agent = new \Civi\Cxn\Rpc\Agent(NULL, NULL); diff --git a/api/v3/Dashboard.php b/api/v3/Dashboard.php index 4fa78a46e6..c18d234d86 100644 --- a/api/v3/Dashboard.php +++ b/api/v3/Dashboard.php @@ -64,8 +64,8 @@ function civicrm_api3_dashboard_get($params) { * @param array $params * Array holding 'id' of dashlet to be deleted. * @return array - * @throws API_Exception - * @throws CiviCRM_API3_Exception + * @throws CRM_Core_Exception + * @throws CRM_Core_Exception */ function civicrm_api3_dashboard_delete($params) { return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params); diff --git a/api/v3/DashboardContact.php b/api/v3/DashboardContact.php index 1662b934d2..ef0941d015 100644 --- a/api/v3/DashboardContact.php +++ b/api/v3/DashboardContact.php @@ -56,7 +56,7 @@ function _civicrm_api3_dashboard_contact_create_spec(&$fields) { * @param array $params * * @return array - * @throws \API_Exception + * @throws \CRM_Core_Exception */ function civicrm_api3_dashboard_contact_delete($params) { return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params); diff --git a/api/v3/Dedupe.php b/api/v3/Dedupe.php index 494e884798..c83a3c46cc 100644 --- a/api/v3/Dedupe.php +++ b/api/v3/Dedupe.php @@ -21,7 +21,7 @@ * @param array $params * * @return array - * @throws \API_Exception + * @throws \CRM_Core_Exception */ function civicrm_api3_dedupe_get($params) { $sql = CRM_Utils_SQL_Select::fragment(); @@ -58,7 +58,7 @@ function _civicrm_api3_dedupe_get_spec(&$params) { * * @return array * - * @throws \API_Exception + * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ function civicrm_api3_dedupe_delete($params) { @@ -71,7 +71,7 @@ function civicrm_api3_dedupe_delete($params) { * @param array $params * * @return array - * @throws \API_Exception + * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ function civicrm_api3_dedupe_create($params) { @@ -84,7 +84,7 @@ function civicrm_api3_dedupe_create($params) { * @param array $params * * @return array - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ function civicrm_api3_dedupe_getstatistics($params) { $stats = CRM_Dedupe_Merger::getMergeStats(CRM_Dedupe_Merger::getMergeCacheKeyString( @@ -134,8 +134,7 @@ function _civicrm_api3_dedupe_getstatistics_spec(&$params) { * @param array $params * * @return array - * @throws \CiviCRM_API3_Exception - * @throws \API_Exception + * @throws \CRM_Core_Exception * @throws \CRM_Core_Exception */ function civicrm_api3_dedupe_getduplicates($params) { diff --git a/api/v3/Domain.php b/api/v3/Domain.php index 974826b30e..3ceda09196 100644 --- a/api/v3/Domain.php +++ b/api/v3/Domain.php @@ -21,7 +21,7 @@ * @param array $params * * @return array - * @throws \API_Exception + * @throws \CRM_Core_Exception */ function civicrm_api3_domain_get($params) { diff --git a/api/v3/Email.php b/api/v3/Email.php index a20bd0dd68..0d78cb2759 100644 --- a/api/v3/Email.php +++ b/api/v3/Email.php @@ -24,7 +24,7 @@ * @return array * API result array * - * @throws \API_Exception + * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ function civicrm_api3_email_create($params) { @@ -58,8 +58,7 @@ function _civicrm_api3_email_create_spec(&$params) { * @return array * API result array. * - * @throws \API_Exception - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ function civicrm_api3_email_delete($params) { diff --git a/api/v3/Event.php b/api/v3/Event.php index f20d6702cf..bfedf30a9c 100644 --- a/api/v3/Event.php +++ b/api/v3/Event.php @@ -25,7 +25,6 @@ * @return array * API result Array. * @throws \CRM_Core_Exception - * @throws \API_Exception */ function civicrm_api3_event_create($params) { // Required fields for creating an event diff --git a/api/v3/Extension.php b/api/v3/Extension.php index 0b654bf642..d70fb5a050 100644 --- a/api/v3/Extension.php +++ b/api/v3/Extension.php @@ -205,18 +205,18 @@ function _civicrm_api3_extension_uninstall_spec(&$fields) { * - key: string, eg "com.example.myextension" * - url: string eg "http://repo.com/myextension-1.0.zip" * - * @throws API_Exception + * @throws CRM_Core_Exception * @return array * API result */ function civicrm_api3_extension_download($params) { if (!array_key_exists('url', $params)) { if (!CRM_Extension_System::singleton()->getBrowser()->isEnabled()) { - throw new API_Exception('Automatic downloading is disabled. Try adding parameter "url"'); + throw new CRM_Core_Exception('Automatic downloading is disabled. Try adding parameter "url"'); } if ($reqs = CRM_Extension_System::singleton()->getBrowser()->checkRequirements()) { $first = array_shift($reqs); - throw new API_Exception($first['message']); + throw new CRM_Core_Exception($first['message']); } if ($info = CRM_Extension_System::singleton()->getBrowser()->getExtension($params['key'])) { if ($info->downloadUrl) { @@ -226,7 +226,7 @@ function civicrm_api3_extension_download($params) { } if (!array_key_exists('url', $params)) { - throw new API_Exception('Cannot resolve download url for extension. Try adding parameter "url"'); + throw new CRM_Core_Exception('Cannot resolve download url for extension. Try adding parameter "url"'); } if (!isset($info)) { diff --git a/api/v3/File.php b/api/v3/File.php index c222ee228a..68780b07ba 100644 --- a/api/v3/File.php +++ b/api/v3/File.php @@ -110,7 +110,7 @@ function civicrm_api3_file_update($params) { * @param array $params * Array per getfields metadata. * @return array API Result Array - * @throws API_Exception + * @throws CRM_Core_Exception */ function civicrm_api3_file_delete($params) { @@ -119,6 +119,6 @@ function civicrm_api3_file_delete($params) { return civicrm_api3_create_success(); } else { - throw new API_Exception('Error while deleting a file.'); + throw new CRM_Core_Exception('Error while deleting a file.'); } } diff --git a/api/v3/FinancialTrxn.php b/api/v3/FinancialTrxn.php index 033e26339e..7da222ce1a 100644 --- a/api/v3/FinancialTrxn.php +++ b/api/v3/FinancialTrxn.php @@ -24,7 +24,7 @@ */ function civicrm_api3_financial_trxn_create($params) { if (empty($params['id']) && empty($params['contribution_id']) && empty($params['entity_id'])) { - throw new API_Exception("Mandatory key(s) missing from params array: both contribution_id and entity_id are missing"); + throw new CRM_Core_Exception("Mandatory key(s) missing from params array: both contribution_id and entity_id are missing"); } return _civicrm_api3_basic_create('CRM_Core_BAO_FinancialTrxn', $params, 'FinancialTrxn'); diff --git a/api/v3/Generic.php b/api/v3/Generic.php index 429ee56acd..4310bd585b 100644 --- a/api/v3/Generic.php +++ b/api/v3/Generic.php @@ -231,7 +231,7 @@ function civicrm_api3_generic_getfield($apiRequest) { * @param array $params * @param array $apiRequest * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception * @throws \Exception */ function _civicrm_api3_generic_getfield_spec(&$params, $apiRequest) { @@ -272,7 +272,7 @@ function _civicrm_api3_generic_getfield_spec(&$params, $apiRequest) { * @param array $apiRequest * Api request as an array. Keys are. * - * @throws API_Exception + * @throws CRM_Core_Exception * @return int * count of results */ @@ -283,7 +283,7 @@ function civicrm_api3_generic_getcount($apiRequest) { return (int) $result['values']; } if (!isset($result['count'])) { - throw new API_Exception(ts('Unexpected result from getcount') . print_r($result, TRUE)); + throw new CRM_Core_Exception(ts('Unexpected result from getcount') . print_r($result, TRUE)); } return $result['count']; } @@ -363,14 +363,14 @@ function _civicrm_api3_generic_getrefcount_spec(&$params, $apiRequest) { * @param array $apiRequest * Api request as an array. * - * @throws API_Exception + * @throws CRM_Core_Exception * @return array * API result (int 0 or 1) */ function civicrm_api3_generic_getrefcount($apiRequest) { $entityToClassMap = CRM_Core_DAO_AllCoreTables::daoToClass(); if (!isset($entityToClassMap[$apiRequest['entity']])) { - throw new API_Exception("The entity '{$apiRequest['entity']}' is unknown or unsupported by 'getrefcount'. Consider implementing this API.", 'getrefcount_unsupported'); + throw new CRM_Core_Exception("The entity '{$apiRequest['entity']}' is unknown or unsupported by 'getrefcount'. Consider implementing this API.", 'getrefcount_unsupported'); } $daoClass = $entityToClassMap[$apiRequest['entity']]; @@ -406,7 +406,7 @@ function civicrm_api3_generic_replace($apiRequest) { * * @return array * Array of results - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ function civicrm_api3_generic_getoptions($apiRequest) { // Resolve aliases. diff --git a/api/v3/Generic/Getactions.php b/api/v3/Generic/Getactions.php index 2d7f3d0126..62b3428860 100644 --- a/api/v3/Generic/Getactions.php +++ b/api/v3/Generic/Getactions.php @@ -19,7 +19,7 @@ * @param array $apiRequest * * @return array - * @throws API_Exception + * @throws CRM_Core_Exception */ function civicrm_api3_generic_getActions($apiRequest) { civicrm_api3_verify_mandatory($apiRequest, NULL, ['entity']); diff --git a/api/v3/Generic/Getlist.php b/api/v3/Generic/Getlist.php index 5a83a71922..9448d324f8 100644 --- a/api/v3/Generic/Getlist.php +++ b/api/v3/Generic/Getlist.php @@ -19,7 +19,7 @@ * @param array $apiRequest * * @return mixed - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ function civicrm_api3_generic_getList($apiRequest) { $entity = CRM_Core_DAO_AllCoreTables::convertEntityNameToLower($apiRequest['entity']); diff --git a/api/v3/Generic/Setvalue.php b/api/v3/Generic/Setvalue.php index 8f6b10ed07..9445a2862a 100644 --- a/api/v3/Generic/Setvalue.php +++ b/api/v3/Generic/Setvalue.php @@ -21,7 +21,7 @@ * * @param array $apiRequest * - * @throws API_Exception + * @throws CRM_Core_Exception * @return array */ function civicrm_api3_generic_setValue($apiRequest) { diff --git a/api/v3/Group.php b/api/v3/Group.php index 6ebd4ded37..940a546fc8 100644 --- a/api/v3/Group.php +++ b/api/v3/Group.php @@ -76,12 +76,12 @@ function civicrm_api3_group_get($params) { * @param array $params * [id] * @return array API result array - * @throws API_Exception + * @throws CRM_Core_Exception */ function civicrm_api3_group_delete($params) { $group = civicrm_api3_group_get(['id' => $params['id']]); if ($group['count'] == 0) { - throw new API_Exception('Could not delete group ' . $params['id']); + throw new CRM_Core_Exception('Could not delete group ' . $params['id']); } CRM_Contact_BAO_Group::discard($params['id']); return civicrm_api3_create_success(TRUE); diff --git a/api/v3/GroupContact.php b/api/v3/GroupContact.php index e9b8e6de88..1233cbff6c 100644 --- a/api/v3/GroupContact.php +++ b/api/v3/GroupContact.php @@ -125,8 +125,8 @@ function civicrm_api3_group_contact_create($params) { * * @param array $params * @return array - * @throws API_Exception - * @throws CiviCRM_API3_Exception + * @throws CRM_Core_Exception + * @throws CRM_Core_Exception * @deprecated */ function civicrm_api3_group_contact_delete($params) { @@ -146,7 +146,7 @@ function civicrm_api3_group_contact_delete($params) { } $groupContact2 = civicrm_api3('GroupContact', 'get', $checkParams); if ($groupContact['count'] == 0 && $groupContact2['count'] == 0) { - throw new API_Exception('Cannot Delete GroupContact'); + throw new CRM_Core_Exception('Cannot Delete GroupContact'); } $params['status'] = CRM_Utils_Array::value('status', $params, empty($params['skip_undelete']) ? 'Removed' : 'Deleted'); // "Deleted" isn't a real option so skip the api wrapper to avoid pseudoconstant validation @@ -265,7 +265,7 @@ function _civicrm_api3_group_contact_common($params, $op = 'Added') { * @param array $params * * @return bool - * @throws \API_Exception + * @throws \CRM_Core_Exception */ function civicrm_api3_group_contact_update_status($params) { diff --git a/api/v3/Job.php b/api/v3/Job.php index f4057444a4..2b04341444 100644 --- a/api/v3/Job.php +++ b/api/v3/Job.php @@ -65,12 +65,11 @@ function _civicrm_api3_job_clone_spec(&$spec) { * @param array $params * * @return array - * @throws \API_Exception - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ function civicrm_api3_job_clone($params) { if (empty($params['id'])) { - throw new API_Exception("Mandatory key(s) missing from params array: id field is required"); + throw new CRM_Core_Exception("Mandatory key(s) missing from params array: id field is required"); } $id = $params['id']; unset($params['id']); @@ -189,9 +188,7 @@ function _civicrm_api3_job_geocode_spec(&$params) { * - makes testing a bit simpler since we can simulate past/future time * * @return array - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ function civicrm_api3_job_send_reminder($params) { //note that $params['rowCount' can be overridden by one of the preferred syntaxes ($options['limit'] = x @@ -201,7 +198,7 @@ function civicrm_api3_job_send_reminder($params) { $params['rowCount'] = 0; $lock = Civi::lockManager()->acquire('worker.core.ActionSchedule'); if (!$lock->isAcquired()) { - throw new API_Exception('Could not acquire lock, another ActionSchedule process is running'); + throw new CRM_Core_Exception('Could not acquire lock, another ActionSchedule process is running'); } CRM_Core_BAO_ActionSchedule::processQueue($params['now'] ?? NULL, $params); @@ -526,7 +523,7 @@ function civicrm_api3_job_process_respondent($params) { * * @return array * API Result Array - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ function civicrm_api3_job_process_batch_merge($params) { $rule_group_id = $params['rule_group_id'] ?? NULL; @@ -666,12 +663,12 @@ function civicrm_api3_job_cleanup($params) { * @param array $params * * @return array - * @throws \API_Exception + * @throws \CRM_Core_Exception */ function civicrm_api3_job_disable_expired_relationships($params) { $result = CRM_Contact_BAO_Relationship::disableExpiredRelationships(); if (!$result) { - throw new API_Exception('Failed to disable all expired relationships.'); + throw new CRM_Core_Exception('Failed to disable all expired relationships.'); } return civicrm_api3_create_success(1, $params, 'Job', 'disable_expired_relationships'); } @@ -687,12 +684,12 @@ function civicrm_api3_job_disable_expired_relationships($params) { * @param array $params * * @return array - * @throws \API_Exception + * @throws \CRM_Core_Exception */ function civicrm_api3_job_group_rebuild($params) { $lock = Civi::lockManager()->acquire('worker.core.GroupRebuild'); if (!$lock->isAcquired()) { - throw new API_Exception('Could not acquire lock, another GroupRebuild process is running'); + throw new CRM_Core_Exception('Could not acquire lock, another GroupRebuild process is running'); } $limit = $params['limit'] ?? 0; @@ -716,7 +713,7 @@ function civicrm_api3_job_group_rebuild($params) { * @param array $params * * @return array - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ function civicrm_api3_job_group_cache_flush(array $params): array { CRM_Contact_BAO_GroupContactCache::deterministicCacheFlush(); @@ -734,7 +731,7 @@ function civicrm_api3_job_group_cache_flush(array $params): array { * * @return array * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ function civicrm_api3_job_acl_cache_flush(array $params): array { CRM_ACL_BAO_Cache::resetCache(); diff --git a/api/v3/LineItem.php b/api/v3/LineItem.php index b255dc1d06..23dc2fd373 100644 --- a/api/v3/LineItem.php +++ b/api/v3/LineItem.php @@ -27,7 +27,7 @@ * @return array * api result array * - * @throws \API_Exception + * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ function civicrm_api3_line_item_create($params) { @@ -73,8 +73,8 @@ function civicrm_api3_line_item_get($params) { * Array containing id of the group to be deleted. * * @return array API result array - * @throws API_Exception - * @throws \CiviCRM_API3_Exception + * @throws CRM_Core_Exception + * @throws \CRM_Core_Exception */ function civicrm_api3_line_item_delete($params) { return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params); diff --git a/api/v3/LocBlock.php b/api/v3/LocBlock.php index f49b1be997..b8c1a2d6c6 100644 --- a/api/v3/LocBlock.php +++ b/api/v3/LocBlock.php @@ -24,8 +24,7 @@ * @return array * API result array. * - * @throws \API_Exception - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ function civicrm_api3_loc_block_create($params) { $entities = []; @@ -71,7 +70,7 @@ function civicrm_api3_loc_block_create($params) { _civicrm_api3_object_to_array($dao, $values[$dao->id]); return civicrm_api3_create_success($values, $params, 'LocBlock', 'create', $dao); } - throw new API_Exception('Unable to create LocBlock. Please check your params.'); + throw new CRM_Core_Exception('Unable to create LocBlock. Please check your params.'); } /** diff --git a/api/v3/Logging.php b/api/v3/Logging.php index 7abc337574..1401abbb17 100644 --- a/api/v3/Logging.php +++ b/api/v3/Logging.php @@ -22,7 +22,7 @@ * * @return array * API Success Array - * @throws \API_Exception + * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ function civicrm_api3_logging_revert($params) { @@ -39,7 +39,7 @@ function civicrm_api3_logging_revert($params) { * * @param array $params * - * @throws \API_Exception + * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ function _civicrm_api3_logging_revert_spec(&$params) { @@ -73,7 +73,7 @@ function _civicrm_api3_logging_revert_spec(&$params) { * * @return array * API Success Array - * @throws \API_Exception + * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ function civicrm_api3_logging_get($params) { @@ -89,7 +89,7 @@ function civicrm_api3_logging_get($params) { * * @param array $params * - * @throws \API_Exception + * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ function _civicrm_api3_logging_get_spec(&$params) { diff --git a/api/v3/Mailing.php b/api/v3/Mailing.php index 9aaaf67df8..90f23c928f 100644 --- a/api/v3/Mailing.php +++ b/api/v3/Mailing.php @@ -23,7 +23,7 @@ * * @return array * API Success Array - * @throws \API_Exception + * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ function civicrm_api3_mailing_create($params) { @@ -34,7 +34,7 @@ function civicrm_api3_mailing_create($params) { unset($safeParams['modified_date']); } if (!$timestampCheck) { - throw new API_Exception("Mailing has not been saved, Content maybe out of date, please refresh the page and try again"); + throw new CRM_Core_Exception("Mailing has not been saved, Content maybe out of date, please refresh the page and try again"); } // If we're going to autosend, then check validity before saving. if (empty($params['is_completed']) && !empty($params['scheduled_date']) @@ -48,7 +48,7 @@ function civicrm_api3_mailing_create($params) { $errors = call_user_func($validationFunction, $params); if (!empty($errors)) { $fields = implode(',', array_keys($errors)); - throw new CiviCRM_API3_Exception("Mailing cannot be sent. There are missing or invalid fields ($fields).", 'cannot-send', $errors); + throw new CRM_Core_Exception("Mailing cannot be sent. There are missing or invalid fields ($fields).", 'cannot-send', $errors); } } @@ -66,14 +66,14 @@ function civicrm_api3_mailing_create($params) { * Should contain an array of entities to retrieve tokens for. * * @return array - * @throws \API_Exception + * @throws \CRM_Core_Exception */ function civicrm_api3_mailing_gettokens($params) { $tokens = []; foreach ((array) $params['entity'] as $ent) { $func = lcfirst($ent) . 'Tokens'; if (!method_exists('CRM_Core_SelectValues', $func)) { - throw new API_Exception('Unknown token entity: ' . $ent); + throw new CRM_Core_Exception('Unknown token entity: ' . $ent); } $tokens = array_merge(CRM_Core_SelectValues::$func(), $tokens); } @@ -161,7 +161,7 @@ function _civicrm_api3_mailing_clone_spec(&$spec) { * @param array $params * * @return array - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ function civicrm_api3_mailing_clone($params) { $BLACKLIST = [ @@ -270,16 +270,16 @@ function _civicrm_api3_mailing_submit_spec(&$spec) { * @param array $params * * @return array - * @throws API_Exception + * @throws CRM_Core_Exception */ function civicrm_api3_mailing_submit($params) { civicrm_api3_verify_mandatory($params, 'CRM_Mailing_DAO_Mailing', ['id']); if (!isset($params['scheduled_date']) && !isset($updateParams['approval_date'])) { - throw new API_Exception("Missing parameter scheduled_date and/or approval_date"); + throw new CRM_Core_Exception("Missing parameter scheduled_date and/or approval_date"); } if (!is_numeric(CRM_Core_Session::getLoggedInContactID())) { - throw new API_Exception("Failed to determine current user"); + throw new CRM_Core_Exception("Failed to determine current user"); } $updateParams = []; @@ -312,7 +312,7 @@ function civicrm_api3_mailing_submit($params) { * * @param array $params * - * @throws API_Exception + * @throws CRM_Core_Exception * @return array */ function civicrm_api3_mailing_event_bounce($params) { @@ -325,7 +325,7 @@ function civicrm_api3_mailing_event_bounce($params) { return civicrm_api3_create_success($params); } else { - throw new API_Exception(ts('Queue event could not be found'), 'no_queue_event'); + throw new CRM_Core_Exception(ts('Queue event could not be found'), 'no_queue_event'); } } @@ -520,7 +520,7 @@ function civicrm_api3_mailing_event_open($params) { * Array per getfields metadata. * * @return array - * @throws \API_Exception + * @throws \CRM_Core_Exception */ function civicrm_api3_mailing_preview($params) { $fromEmail = NULL; @@ -593,12 +593,11 @@ function _civicrm_api3_mailing_send_test_spec(&$spec) { * @param array $params * * @return array - * @throws \API_Exception - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ function civicrm_api3_mailing_send_test($params) { if (!array_key_exists('test_group', $params) && !array_key_exists('test_email', $params)) { - throw new API_Exception("Mandatory key(s) missing from params array: test_group and/or test_email field are required"); + throw new CRM_Core_Exception("Mandatory key(s) missing from params array: test_group and/or test_email field are required"); } civicrm_api3_verify_mandatory($params, 'CRM_Mailing_DAO_MailingJob', @@ -709,7 +708,7 @@ function _civicrm_api3_mailing_stats_spec(&$params) { * @param array $params * * @return array - * @throws \API_Exception + * @throws \CRM_Core_Exception */ function civicrm_api3_mailing_stats($params) { civicrm_api3_verify_mandatory($params, diff --git a/api/v3/MailingAB.php b/api/v3/MailingAB.php index 1c70fab2f8..07d2bdde51 100644 --- a/api/v3/MailingAB.php +++ b/api/v3/MailingAB.php @@ -96,22 +96,22 @@ function _civicrm_api3_mailing_a_b_submit_spec(&$spec) { * @param array $params * * @return array - * @throws API_Exception + * @throws CRM_Core_Exception */ function civicrm_api3_mailing_a_b_submit($params) { civicrm_api3_verify_mandatory($params, 'CRM_Mailing_DAO_MailingAB', ['id', 'status']); if (!isset($params['scheduled_date']) && !isset($updateParams['approval_date'])) { - throw new API_Exception("Missing parameter scheduled_date and/or approval_date"); + throw new CRM_Core_Exception("Missing parameter scheduled_date and/or approval_date"); } $dao = new CRM_Mailing_DAO_MailingAB(); $dao->id = $params['id']; if (!$dao->find(TRUE)) { - throw new API_Exception("Failed to locate A/B test by ID"); + throw new CRM_Core_Exception("Failed to locate A/B test by ID"); } if (empty($dao->mailing_id_a) || empty($dao->mailing_id_b) || empty($dao->mailing_id_c)) { - throw new API_Exception("Missing mailing IDs for A/B test"); + throw new CRM_Core_Exception("Missing mailing IDs for A/B test"); } $submitParams = CRM_Utils_Array::subset($params, [ @@ -124,7 +124,7 @@ function civicrm_api3_mailing_a_b_submit($params) { switch ($params['status']) { case 'Testing': if (!empty($dao->status) && $dao->status != 'Draft') { - throw new API_Exception("Cannot transition to state 'Testing'"); + throw new CRM_Core_Exception("Cannot transition to state 'Testing'"); } civicrm_api3('Mailing', 'submit', $submitParams + [ 'id' => $dao->mailing_id_a, @@ -139,7 +139,7 @@ function civicrm_api3_mailing_a_b_submit($params) { case 'Final': if ($dao->status != 'Testing') { - throw new API_Exception("Cannot transition to state 'Final'"); + throw new CRM_Core_Exception("Cannot transition to state 'Final'"); } if (!empty($params['winner_id'])) { _civicrm_api3_mailing_a_b_fill_winner($params['winner_id'], $dao->mailing_id_c); @@ -151,7 +151,7 @@ function civicrm_api3_mailing_a_b_submit($params) { break; default: - throw new API_Exception("Unrecognized submission status"); + throw new CRM_Core_Exception("Unrecognized submission status"); } return civicrm_api3('MailingAB', 'create', [ @@ -168,7 +168,7 @@ function civicrm_api3_mailing_a_b_submit($params) { * The experimental mailing chosen as the "winner". * @param int $final_id * The final mailing which should imitate the "winner". - * @throws \API_Exception + * @throws \CRM_Core_Exception */ function _civicrm_api3_mailing_a_b_fill_winner($winner_id, $final_id) { $copyFields = [ @@ -206,7 +206,7 @@ function _civicrm_api3_mailing_a_b_fill_winner($winner_id, $final_id) { ->execute() ->fetchAll(); if (count($f) !== 1) { - throw new API_Exception('Invalid winner_id'); + throw new CRM_Core_Exception('Invalid winner_id'); } foreach ($f as $winner) { civicrm_api3('Mailing', 'create', $winner + [ @@ -250,7 +250,7 @@ function _civicrm_api3_mailing_a_b_graph_stats_spec(&$params) { * @param array $params * * @return array - * @throws API_Exception + * @throws CRM_Core_Exception */ function civicrm_api3_mailing_a_b_graph_stats($params) { civicrm_api3_verify_mandatory($params, @@ -305,7 +305,7 @@ function civicrm_api3_mailing_a_b_graph_stats($params) { case 'total clicks on a particular link': if (empty($params['target_url'])) { - throw new API_Exception("Provide url to get stats result for total clicks on a particular link"); + throw new CRM_Core_Exception("Provide url to get stats result for total clicks on a particular link"); } // FIXME: doesn't make sense to get url_id mailing_id_(a|b) while getting start date in mailing_id_a $url_id = CRM_Mailing_BAO_TrackableURL::getTrackerURLId($mailingAB[$column], $params['target_url']); diff --git a/api/v3/MailingComponent.php b/api/v3/MailingComponent.php index 8f90adecbb..e014d743b6 100644 --- a/api/v3/MailingComponent.php +++ b/api/v3/MailingComponent.php @@ -20,7 +20,7 @@ * * @param array $params * - * @throws API_Exception + * @throws CRM_Core_Exception * @return array * API result array. */ @@ -69,7 +69,7 @@ function _civicrm_api3_mailing_component_get_spec(&$params) { * * @param array $params * - * @throws API_Exception + * @throws CRM_Core_Exception * @return array * API result array. */ diff --git a/api/v3/MailingContact.php b/api/v3/MailingContact.php index 2ef5194da7..5074124d80 100644 --- a/api/v3/MailingContact.php +++ b/api/v3/MailingContact.php @@ -44,7 +44,7 @@ function _civicrm_api3_mailing_contact_getresults($params, $count) { $options = _civicrm_api3_get_options_from_params($params, TRUE, 'contribution', 'get'); $fnName = '_civicrm_api3_mailing_contact_get_' . strtolower($params['type']); if (!function_exists($fnName)) { - throw new API_Exception('Invalid mailing type: ' . $params['type']); + throw new CRM_Core_Exception('Invalid mailing type: ' . $params['type']); } return $fnName( $params['contact_id'], diff --git a/api/v3/MailingEventQueue.php b/api/v3/MailingEventQueue.php index 9625809fdb..8e046d2823 100644 --- a/api/v3/MailingEventQueue.php +++ b/api/v3/MailingEventQueue.php @@ -27,7 +27,7 @@ */ function civicrm_api3_mailing_event_queue_create($params) { if (!array_key_exists('id', $params) && !array_key_exists('email_id', $params) && !array_key_exists('phone_id', $params)) { - throw new API_Exception("Mandatory key missing from params array: id, email_id, or phone_id field is required"); + throw new CRM_Core_Exception("Mandatory key missing from params array: id, email_id, or phone_id field is required"); } civicrm_api3_verify_mandatory($params, 'CRM_Mailing_DAO_MailingJob', @@ -54,7 +54,7 @@ function civicrm_api3_mailing_event_queue_get($params) { * @param array $params * * @return array - * @throws \API_Exception + * @throws \CRM_Core_Exception */ function civicrm_api3_mailing_event_queue_delete($params) { return _civicrm_api3_basic_delete('CRM_Mailing_Event_BAO_Queue', $params); diff --git a/api/v3/MailingEventSubscribe.php b/api/v3/MailingEventSubscribe.php index 8e64faa365..c51650d36d 100644 --- a/api/v3/MailingEventSubscribe.php +++ b/api/v3/MailingEventSubscribe.php @@ -22,7 +22,7 @@ * @param array $params * Array per getfields metadata. * - * @throws API_Exception + * @throws CRM_Core_Exception * @return array * api result array */ @@ -35,11 +35,11 @@ function civicrm_api3_mailing_event_subscribe_create($params) { $group->is_active = 1; $group->id = (int) $group_id; if (!$group->find(TRUE)) { - throw new API_Exception('Invalid Group id'); + throw new CRM_Core_Exception('Invalid Group id'); } if (substr($group->visibility, 0, 6) != 'Public') { - throw new API_Exception('Group is not Public. Contact cannot be subscribed to this Group.'); + throw new CRM_Core_Exception('Group is not Public. Contact cannot be subscribed to this Group.'); } $subscribe = CRM_Mailing_Event_BAO_Subscribe::subscribe($group_id, $email, $contact_id); diff --git a/api/v3/MailingGroup.php b/api/v3/MailingGroup.php index 062d008562..8cfab0f830 100644 --- a/api/v3/MailingGroup.php +++ b/api/v3/MailingGroup.php @@ -92,7 +92,7 @@ function civicrm_api3_mailing_group_event_subscribe($params) { * @param array $params * * @return array - * @throws \API_Exception + * @throws \CRM_Core_Exception */ function civicrm_api3_mailing_group_create($params) { return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params); @@ -115,7 +115,7 @@ function civicrm_api3_mailing_group_get($params) { * @param array $params * * @return array - * @throws \API_Exception + * @throws \CRM_Core_Exception */ function civicrm_api3_mailing_group_delete($params) { return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params); diff --git a/api/v3/MailingJob.php b/api/v3/MailingJob.php index 4631d9bc5b..7634bf170d 100644 --- a/api/v3/MailingJob.php +++ b/api/v3/MailingJob.php @@ -22,7 +22,7 @@ * @param array $params * * @return array - * @throws \API_Exception + * @throws \CRM_Core_Exception */ function civicrm_api3_mailing_job_create($params) { return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params, 'MailingJob'); @@ -60,7 +60,7 @@ function civicrm_api3_mailing_job_get($params) { * @param array $params * * @return array - * @throws \API_Exception + * @throws \CRM_Core_Exception */ function civicrm_api3_mailing_job_delete($params) { return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params, 'MailingJob'); diff --git a/api/v3/Membership.php b/api/v3/Membership.php index 7804ee3818..7cb21fee7d 100644 --- a/api/v3/Membership.php +++ b/api/v3/Membership.php @@ -39,7 +39,7 @@ function _civicrm_api3_membership_delete_spec(&$params) { * @param array $params * Array array holding id - Id of the contact membership to be deleted. * @return array API result array. - * @throws API_Exception + * @throws CRM_Core_Exception */ function civicrm_api3_membership_delete($params) { if (isset($params['preserve_contribution'])) { @@ -47,7 +47,7 @@ function civicrm_api3_membership_delete($params) { return civicrm_api3_create_success(TRUE, $params); } else { - throw new API_Exception(ts('Could not delete membership')); + throw new CRM_Core_Exception(ts('Could not delete membership')); } } else { @@ -68,7 +68,6 @@ function civicrm_api3_membership_delete($params) { * API result array. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ function civicrm_api3_membership_create($params) { // check params for membership id during update diff --git a/api/v3/MembershipStatus.php b/api/v3/MembershipStatus.php index 906d9f3643..c4f6fa5f2e 100644 --- a/api/v3/MembershipStatus.php +++ b/api/v3/MembershipStatus.php @@ -106,14 +106,14 @@ function civicrm_api3_membership_status_update($params) { * * @param array $params * @return array - * @throws API_Exception + * @throws CRM_Core_Exception * @throws CRM_Core_Exception */ function civicrm_api3_membership_status_delete($params) { $memberStatusDelete = CRM_Member_BAO_MembershipStatus::del($params['id'], TRUE); if ($memberStatusDelete) { - throw new API_Exception($memberStatusDelete['error_message']); + throw new CRM_Core_Exception($memberStatusDelete['error_message']); } return civicrm_api3_create_success(); } @@ -126,14 +126,14 @@ function civicrm_api3_membership_status_delete($params) { * * @param array $membershipParams * - * @throws API_Exception + * @throws CRM_Core_Exception * * @return array * Array of status id and status name */ function civicrm_api3_membership_status_calc($membershipParams) { if (!($membershipID = CRM_Utils_Array::value('membership_id', $membershipParams))) { - throw new API_Exception('membershipParams do not contain membership_id'); + throw new CRM_Core_Exception('membershipParams do not contain membership_id'); } if (empty($membershipParams['id'])) { @@ -157,7 +157,7 @@ SELECT start_date, end_date, join_date, membership_type_id } } else { - throw new API_Exception('did not find a membership record'); + throw new CRM_Core_Exception('did not find a membership record'); } return $result; } diff --git a/api/v3/MessageTemplate.php b/api/v3/MessageTemplate.php index 40a7a55908..89b285e75d 100644 --- a/api/v3/MessageTemplate.php +++ b/api/v3/MessageTemplate.php @@ -21,7 +21,7 @@ * @param array $params * * @return array - * @throws \API_Exception + * @throws \CRM_Core_Exception */ function civicrm_api3_message_template_create($params) { return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params, 'MessageTemplate'); @@ -84,7 +84,7 @@ function civicrm_api3_message_template_get($params) { * * @param array $params * - * @throws API_Exception + * @throws CRM_Core_Exception * @throws \CRM_Core_Exception */ function civicrm_api3_message_template_send($params) { @@ -110,7 +110,7 @@ function civicrm_api3_message_template_send($params) { if (empty($params['messageTemplateID'])) { if (empty($params['workflow'])) { // Can't use civicrm_api3_verify_mandatory for this because it would give the wrong field names - throw new API_Exception( + throw new CRM_Core_Exception( 'Mandatory key(s) missing from params array: requires id or workflow', 'mandatory_missing', ['fields' => ['id', 'workflow']] diff --git a/api/v3/OptionValue.php b/api/v3/OptionValue.php index d29f4977f3..34a2b00507 100644 --- a/api/v3/OptionValue.php +++ b/api/v3/OptionValue.php @@ -46,7 +46,7 @@ function _civicrm_api3_option_value_get_spec(&$params) { * * @param array $params * - * @throws API_Exception + * @throws CRM_Core_Exception * @return array * API result array */ @@ -86,7 +86,7 @@ function _civicrm_api3_option_value_create_spec(&$params) { * * @param array $params * @return array API result array - * @throws API_Exception + * @throws CRM_Core_Exception */ function civicrm_api3_option_value_delete($params) { // We will get the option group id before deleting so we can flush pseudoconstants. @@ -97,6 +97,6 @@ function civicrm_api3_option_value_delete($params) { return civicrm_api3_create_success(); } else { - throw new API_Exception('Could not delete OptionValue ' . $params['id']); + throw new CRM_Core_Exception('Could not delete OptionValue ' . $params['id']); } } diff --git a/api/v3/Order.php b/api/v3/Order.php index 3b495b93a2..5669b163e9 100644 --- a/api/v3/Order.php +++ b/api/v3/Order.php @@ -26,7 +26,7 @@ use Civi\Api4\Membership; * * @return array * Array of Order, if error an array with an error id and error message - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ function civicrm_api3_order_get(array $params): array { $contributions = []; @@ -70,8 +70,8 @@ function _civicrm_api3_order_get_spec(array &$params) { * @return array * Api result array * - * @throws \CiviCRM_API3_Exception - * @throws API_Exception + * @throws \CRM_Core_Exception + * @throws CRM_Core_Exception */ function civicrm_api3_order_create(array $params): array { civicrm_api3_verify_one_mandatory($params, NULL, ['line_items', 'total_amount']); @@ -129,7 +129,7 @@ function civicrm_api3_order_create(array $params): array { if ($entityParams['entity'] === 'participant') { if (isset($entityParams['participant_status_id']) && (!CRM_Event_BAO_ParticipantStatusType::getIsValidStatusForClass($entityParams['participant_status_id'], 'Pending'))) { - throw new CiviCRM_API3_Exception('Creating a participant via the Order API with a non "pending" status is not supported'); + throw new CRM_Core_Exception('Creating a participant via the Order API with a non "pending" status is not supported'); } $entityParams['participant_status_id'] = $entityParams['participant_status_id'] ?? 'Pending from incomplete transaction'; $entityParams['status_id'] = $entityParams['participant_status_id']; @@ -190,8 +190,8 @@ function civicrm_api3_order_create(array $params): array { * Input parameters. * * @return array - * @throws API_Exception - * @throws CiviCRM_API3_Exception + * @throws CRM_Core_Exception + * @throws CRM_Core_Exception */ function civicrm_api3_order_delete(array $params): array { $contribution = civicrm_api3('Contribution', 'get', [ @@ -202,7 +202,7 @@ function civicrm_api3_order_delete(array $params): array { $result = civicrm_api3('Contribution', 'delete', $params); } else { - throw new API_Exception('Only test orders can be deleted.'); + throw new CRM_Core_Exception('Only test orders can be deleted.'); } return civicrm_api3_create_success($result['values'], $params, 'Order', 'delete'); } @@ -214,7 +214,7 @@ function civicrm_api3_order_delete(array $params): array { * Input parameters. * * @return array - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ function civicrm_api3_order_cancel(array $params) { $contributionStatuses = CRM_Contribute_PseudoConstant::contributionStatus(NULL, 'name'); @@ -304,7 +304,7 @@ function _civicrm_api3_order_delete_spec(array &$params) { * * @param array $membershipParams * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ function _order_create_wrangle_membership_params(array &$membershipParams) { $fields = Membership::getFields(FALSE)->execute()->indexBy('name'); diff --git a/api/v3/Participant.php b/api/v3/Participant.php index d9932b2bb8..e37625d8a9 100644 --- a/api/v3/Participant.php +++ b/api/v3/Participant.php @@ -24,7 +24,6 @@ * @return array * API result array * - * @throws \CiviCRM_API3_Exception * @throws \CRM_Core_Exception */ function civicrm_api3_participant_create($params) { @@ -58,7 +57,7 @@ function civicrm_api3_participant_create($params) { * @param array $params * @param CRM_Event_BAO_Participant $participant * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ function _civicrm_api3_participant_createlineitem(&$params, $participant) { // it is possible that a fee level contains information about multiple diff --git a/api/v3/ParticipantStatusType.php b/api/v3/ParticipantStatusType.php index 49899c796d..5a9fff8e61 100644 --- a/api/v3/ParticipantStatusType.php +++ b/api/v3/ParticipantStatusType.php @@ -53,12 +53,12 @@ function civicrm_api3_participant_status_type_get($params) { * @param array $params * [id] * @return array api result array - * @throws API_Exception + * @throws CRM_Core_Exception */ function civicrm_api3_participant_status_type_delete($params) { if (CRM_Event_BAO_ParticipantStatusType::deleteParticipantStatusType($params['id'])) { return civicrm_api3_create_success(TRUE); } - throw new API_Exception('Could not delete participant status type id ' . $params['id']); + throw new CRM_Core_Exception('Could not delete participant status type id ' . $params['id']); } diff --git a/api/v3/Payment.php b/api/v3/Payment.php index 437d0e5a4e..94cb94b644 100644 --- a/api/v3/Payment.php +++ b/api/v3/Payment.php @@ -24,7 +24,7 @@ * @return array * Array of financial transactions which are payments, if error an array with an error id and error message * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ function civicrm_api3_payment_get($params) { $params['is_payment'] = TRUE; @@ -72,7 +72,7 @@ function civicrm_api3_payment_get($params) { * @return array * Api result array * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ function civicrm_api3_payment_delete($params) { return civicrm_api3('FinancialTrxn', 'delete', $params); @@ -87,8 +87,8 @@ function civicrm_api3_payment_delete($params) { * @return array * Api result array * - * @throws \CiviCRM_API3_Exception - * @throws API_Exception + * @throws \CRM_Core_Exception + * @throws CRM_Core_Exception */ function civicrm_api3_payment_cancel($params) { $eftParams = [ @@ -125,7 +125,6 @@ function civicrm_api3_payment_cancel($params) { * Api result array * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ function civicrm_api3_payment_create($params) { if (empty($params['skipCleanMoney'])) { diff --git a/api/v3/PaymentProcessor.php b/api/v3/PaymentProcessor.php index ba98d4fa71..0570cc6e37 100644 --- a/api/v3/PaymentProcessor.php +++ b/api/v3/PaymentProcessor.php @@ -107,8 +107,7 @@ function _civicrm_api3_payment_processor_getlist_defaults(&$request) { * @return array * API result array. * - * @throws \API_Exception - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ function civicrm_api3_payment_processor_pay($params) { $processor = Civi\Payment\System::singleton()->getById($params['payment_processor_id']); @@ -123,7 +122,7 @@ function civicrm_api3_payment_processor_pay($params) { $code = 'EXTERNAL_FAILURE'; } $message = $e->getMessage() ?? 'Payment Failed'; - throw new API_Exception($message, $code, $errorData, $e); + throw new CRM_Core_Exception($message, $code, $errorData, $e); } return civicrm_api3_create_success(array($result), $params); } @@ -172,8 +171,7 @@ function _civicrm_api3_payment_processor_pay_spec(&$params) { * @return array * API result array. * - * @throws \API_Exception - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception * @throws \Civi\Payment\Exception\PaymentProcessorException */ function civicrm_api3_payment_processor_refund($params) { @@ -181,7 +179,7 @@ function civicrm_api3_payment_processor_refund($params) { $processor = Civi\Payment\System::singleton()->getById($params['payment_processor_id']); $processor->setPaymentProcessor(civicrm_api3('PaymentProcessor', 'getsingle', ['id' => $params['payment_processor_id']])); if (!$processor->supportsRefund()) { - throw new API_Exception('Payment Processor does not support refund'); + throw new CRM_Core_Exception('Payment Processor does not support refund'); } $result = $processor->doRefund($params); return civicrm_api3_create_success([$result], $params); diff --git a/api/v3/Pledge.php b/api/v3/Pledge.php index 571924b193..98d3a24c9c 100644 --- a/api/v3/Pledge.php +++ b/api/v3/Pledge.php @@ -22,7 +22,7 @@ * * @return array * Array containing 'is_error' to denote success or failure and details of the created pledge - * @throws \API_Exception + * @throws \CRM_Core_Exception */ function civicrm_api3_pledge_create($params) { _civicrm_api3_pledge_format_params($params, TRUE); diff --git a/api/v3/Premium.php b/api/v3/Premium.php index ae1a170830..41f1ae1519 100644 --- a/api/v3/Premium.php +++ b/api/v3/Premium.php @@ -24,7 +24,7 @@ * * @param array $params * - * @throws API_Exception + * @throws CRM_Core_Exception * @return array */ function civicrm_api3_premium_create($params) { @@ -48,7 +48,7 @@ function civicrm_api3_premium_get($params) { * * @param array $params * - * @throws API_Exception + * @throws CRM_Core_Exception * @return array * Array of deleted values. */ diff --git a/api/v3/Product.php b/api/v3/Product.php index 5cc7413e1e..b75149e125 100644 --- a/api/v3/Product.php +++ b/api/v3/Product.php @@ -23,7 +23,7 @@ * * @param array $params * - * @throws API_Exception + * @throws CRM_Core_Exception * @return array */ function civicrm_api3_product_create($params) { @@ -60,7 +60,7 @@ function civicrm_api3_product_get($params) { * * @param array $params * - * @throws API_Exception + * @throws CRM_Core_Exception * @return array * Array of deleted values. */ diff --git a/api/v3/Profile.php b/api/v3/Profile.php index 6afa73b30a..78306eb6ec 100644 --- a/api/v3/Profile.php +++ b/api/v3/Profile.php @@ -33,12 +33,12 @@ * * @return array * @throws \CRM_Core_Exception - * @throws API_Exception + * @throws CRM_Core_Exception */ function civicrm_api3_profile_get($params) { $nonStandardLegacyBehaviour = is_numeric($params['profile_id']); if (!empty($params['check_permissions']) && !empty($params['contact_id']) && !1 === civicrm_api3('contact', 'getcount', ['contact_id' => $params['contact_id'], 'check_permissions' => 1])) { - throw new API_Exception('permission denied'); + throw new CRM_Core_Exception('permission denied'); } $profiles = (array) $params['profile_id']; $values = []; @@ -51,7 +51,7 @@ function civicrm_api3_profile_get($params) { continue; } if (!CRM_Core_DAO::getFieldValue('CRM_Core_DAO_UFGroup', $profileID, 'is_active')) { - throw new API_Exception('Invalid value for profile_id : ' . $profileID); + throw new CRM_Core_Exception('Invalid value for profile_id : ' . $profileID); } $isContactActivityProfile = CRM_Core_BAO_UFField::checkContactActivityProfileType($profileID); @@ -76,7 +76,7 @@ function civicrm_api3_profile_get($params) { $params['profile_id'] ); if (!empty($errors)) { - throw new API_Exception(array_pop($errors)); + throw new CRM_Core_Exception(array_pop($errors)); } $contactFields = $activityFields = []; @@ -140,7 +140,7 @@ function _civicrm_api3_profile_get_spec(&$params) { * * @param array $params * - * @throws API_Exception + * @throws CRM_Core_Exception * @return array * API result array */ @@ -148,13 +148,13 @@ function civicrm_api3_profile_submit($params) { $profileID = _civicrm_api3_profile_getProfileID($params['profile_id']); if (!CRM_Core_DAO::getFieldValue('CRM_Core_DAO_UFGroup', $profileID, 'is_active')) { //@todo declare pseudoconstant & let api do this - throw new API_Exception('Invalid value for profile_id'); + throw new CRM_Core_Exception('Invalid value for profile_id'); } $isContactActivityProfile = CRM_Core_BAO_UFField::checkContactActivityProfileType($profileID); if (!empty($params['id']) && CRM_Core_BAO_UFField::checkProfileType($profileID) && !$isContactActivityProfile) { - throw new API_Exception('Update profiles including more than one entity not currently supported'); + throw new CRM_Core_Exception('Update profiles including more than one entity not currently supported'); } $contactParams = $activityParams = $missingParams = []; @@ -169,7 +169,7 @@ function civicrm_api3_profile_submit($params) { $profileID ); if (!empty($errors)) { - throw new API_Exception(array_pop($errors)); + throw new CRM_Core_Exception(array_pop($errors)); } } @@ -339,7 +339,7 @@ function civicrm_api3_profile_set($params) { * Array of property name/value. * pairs to profile field values * - * @throws API_Exception + * @throws CRM_Core_Exception * @return array * * @todo add example @@ -367,7 +367,7 @@ function civicrm_api3_profile_apply($params) { ); if (empty($data)) { - throw new API_Exception('Unable to format profile parameters.'); + throw new CRM_Core_Exception('Unable to format profile parameters.'); } return civicrm_api3_create_success($data); @@ -699,7 +699,7 @@ function _civicrm_api3_map_profile_fields_to_entity(&$field) { * @param int $profileID * * @return int|string - * @throws CiviCRM_API3_Exception + * @throws CRM_Core_Exception */ function _civicrm_api3_profile_getProfileID($profileID) { if (!empty($profileID) && strtolower($profileID) != 'billing' && !is_numeric($profileID)) { diff --git a/api/v3/Relationship.php b/api/v3/Relationship.php index 50ae6e61a5..f1f7664bee 100644 --- a/api/v3/Relationship.php +++ b/api/v3/Relationship.php @@ -21,7 +21,7 @@ * @param array $params * Input parameters. * - * @throws API_Exception + * @throws CRM_Core_Exception * * @return array * API Result Array diff --git a/api/v3/ReportTemplate.php b/api/v3/ReportTemplate.php index 60b1068b19..0deb7b998f 100644 --- a/api/v3/ReportTemplate.php +++ b/api/v3/ReportTemplate.php @@ -41,7 +41,7 @@ function civicrm_api3_report_template_get($params) { * @return array * API result array * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ function civicrm_api3_report_template_create($params) { require_once 'api/v3/OptionValue.php'; @@ -82,7 +82,7 @@ function _civicrm_api3_report_template_create_spec(&$params) { * @return array * API result array * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ function civicrm_api3_report_template_delete($params) { require_once 'api/v3/OptionValue.php'; @@ -98,8 +98,7 @@ function civicrm_api3_report_template_delete($params) { * @return array * API result array * - * @throws \API_Exception - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ function civicrm_api3_report_template_getrows($params) { civicrm_api3_verify_one_mandatory($params, NULL, ['report_id', 'instance_id']); @@ -114,8 +113,8 @@ function civicrm_api3_report_template_getrows($params) { * @param array $params * * @return array - * @throws API_Exception - * @throws CiviCRM_API3_Exception + * @throws CRM_Core_Exception + * @throws CRM_Core_Exception */ function _civicrm_api3_report_template_getrows($params) { if (empty($params['report_id'])) { @@ -177,8 +176,7 @@ function _civicrm_api3_report_template_getrows($params) { * @return array * API result array * - * @throws \API_Exception - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ function civicrm_api3_report_template_getstatistics($params) { list($rows, $reportInstance, $metadata) = _civicrm_api3_report_template_getrows($params); diff --git a/api/v3/SavedSearch.php b/api/v3/SavedSearch.php index ca01c6fc4e..bae73cc520 100644 --- a/api/v3/SavedSearch.php +++ b/api/v3/SavedSearch.php @@ -42,7 +42,7 @@ * api result array * {@getfields saved_search_create} * - * @throws \API_Exception + * @throws \CRM_Core_Exception * * @example SavedSearch/Create.php Std create example. * @access public @@ -72,8 +72,7 @@ function _civicrm_api3_saved_search_create_spec(&$fields) { * api result array * {@getfields saved_search_delete} * - * @throws \API_Exception - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception * * @example SavedSearch/Delete.php Std delete example. * @access public diff --git a/api/v3/Setting.php b/api/v3/Setting.php index 133d90b578..2420e65865 100644 --- a/api/v3/Setting.php +++ b/api/v3/Setting.php @@ -90,7 +90,7 @@ function _civicrm_api3_setting_getfields_spec(&$params) { * @param array $params * * @return array - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception * @throws \Exception */ function civicrm_api3_setting_getdefaults($params) { @@ -129,14 +129,14 @@ function _civicrm_api3_setting_getdefaults_spec(&$params) { * @param array $params * * @return array - * @throws \API_Exception + * @throws \CRM_Core_Exception */ function civicrm_api3_setting_getoptions($params) { $domainId = $params['domain_id'] ?? NULL; $specs = \Civi\Core\SettingsMetadata::getMetadata(['name' => $params['field']], $domainId, TRUE); if (!isset($specs[$params['field']]['options']) || !is_array($specs[$params['field']]['options'])) { - throw new API_Exception("The field '" . $params['field'] . "' has no associated option list."); + throw new CRM_Core_Exception("The field '" . $params['field'] . "' has no associated option list."); } return civicrm_api3_create_success($specs[$params['field']]['options'], $params, 'Setting', 'getoptions'); @@ -197,7 +197,7 @@ function _civicrm_api3_setting_revert_spec(&$params) { * @param array $params * @deprecated * @return array - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception * @throws \Exception */ function civicrm_api3_setting_fill($params) { @@ -258,8 +258,7 @@ function _civicrm_api3_setting_deprecation() { * @return array * api result array * - * @throws \API_Exception - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ function civicrm_api3_setting_create($params) { $domains = _civicrm_api3_setting_getDomainArray($params); @@ -391,7 +390,7 @@ function _civicrm_api3_setting_getvalue_spec(&$params) { * @param array $params * * @return array - * @throws API_Exception + * @throws CRM_Core_Exception */ function _civicrm_api3_setting_getDomainArray(&$params) { if (empty($params['domain_id']) && isset($params['id'])) { @@ -408,7 +407,7 @@ function _civicrm_api3_setting_getDomainArray(&$params) { $params['domain_id'] = array_keys($domainAPIResult['values']); } else { - throw new API_Exception('All domains not retrieved - problem with Domain Get api call ' . $domainAPIResult['error_message']); + throw new CRM_Core_Exception('All domains not retrieved - problem with Domain Get api call ' . $domainAPIResult['error_message']); } } if (is_array($params['domain_id'])) { diff --git a/api/v3/StateProvince.php b/api/v3/StateProvince.php index 582deed300..bbc4b4a1ae 100644 --- a/api/v3/StateProvince.php +++ b/api/v3/StateProvince.php @@ -23,7 +23,7 @@ * * @return array * API result array - * @throws \API_Exception + * @throws \CRM_Core_Exception */ function civicrm_api3_state_province_create($params) { return _civicrm_api3_basic_create(_civicrm_api3_get_DAO(__FUNCTION__), $params, 'StateProvince'); diff --git a/api/v3/System.php b/api/v3/System.php index 0e0b3c679b..9ce36d94cf 100644 --- a/api/v3/System.php +++ b/api/v3/System.php @@ -125,7 +125,7 @@ function _civicrm_api3_system_check_spec(&$spec) { * API result descriptor; return items are alert codes/messages * @see civicrm_api3_create_success * @see civicrm_api3_create_error - * @throws API_Exception + * @throws CRM_Core_Exception */ function civicrm_api3_system_check($params) { // array(array('name'=> $, 'severity'=>$, ...)) @@ -334,7 +334,7 @@ function _civicrm_api3_system_get_redacted_mysql() { * Get redacted settings. * * @return array - * @throws CiviCRM_API3_Exception + * @throws CRM_Core_Exception */ function _civicrm_api3_system_get_redacted_settings() { static $whitelist = NULL; @@ -394,7 +394,7 @@ function civicrm_api3_system_updatelogtables($params) { * * @return array * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ function civicrm_api3_system_utf8conversion($params) { $params['patterns'] = explode(',', $params['patterns']); @@ -407,7 +407,7 @@ function civicrm_api3_system_utf8conversion($params) { ) { return civicrm_api3_create_success(1); } - throw new API_Exception('Conversion failed'); + throw new CRM_Core_Exception('Conversion failed'); } /** @@ -536,6 +536,6 @@ function civicrm_api3_system_rebuildmultilingualschema() { return civicrm_api3_create_success(1); } else { - throw new API_Exception('Cannot call rebuild Multilingual schema on non Multilingual database'); + throw new CRM_Core_Exception('Cannot call rebuild Multilingual schema on non Multilingual database'); } } diff --git a/api/v3/UFField.php b/api/v3/UFField.php index 2c6d81ea28..0ac6b070d2 100644 --- a/api/v3/UFField.php +++ b/api/v3/UFField.php @@ -21,7 +21,7 @@ * @param array $params * Array per getfields metadata. * - * @throws API_Exception + * @throws CRM_Core_Exception * * @return array * Newly created $ufFieldArray @@ -65,7 +65,7 @@ function civicrm_api3_uf_field_get($params) { * * @param array $params * - * @throws API_Exception + * @throws CRM_Core_Exception * * @return array */ @@ -74,7 +74,7 @@ function civicrm_api3_uf_field_delete($params) { $ufGroupId = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_UFField', $fieldId, 'uf_group_id'); if (!$ufGroupId) { - throw new API_Exception('Invalid value for field_id.'); + throw new CRM_Core_Exception('Invalid value for field_id.'); } $result = CRM_Core_BAO_UFField::del($fieldId); diff --git a/api/v3/Website.php b/api/v3/Website.php index 8ed541af12..8cb4b98bd8 100644 --- a/api/v3/Website.php +++ b/api/v3/Website.php @@ -46,7 +46,7 @@ function _civicrm_api3_website_create_spec(&$params) { * * @return array * API result array - * @throws \API_Exception + * @throws \CRM_Core_Exception */ function civicrm_api3_website_delete($params) { return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params); diff --git a/api/v3/WordReplacement.php b/api/v3/WordReplacement.php index 7569e4e22e..24be72dcc7 100644 --- a/api/v3/WordReplacement.php +++ b/api/v3/WordReplacement.php @@ -24,7 +24,7 @@ * @param array $params * * @return array - * @throws \API_Exception + * @throws \CRM_Core_Exception */ function civicrm_api3_word_replacement_get($params) { return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params); diff --git a/api/v3/examples/Activity/ContactRefCustomField.ex.php b/api/v3/examples/Activity/ContactRefCustomField.ex.php index 6ad066c634..e8e90c1d92 100644 --- a/api/v3/examples/Activity/ContactRefCustomField.ex.php +++ b/api/v3/examples/Activity/ContactRefCustomField.ex.php @@ -29,7 +29,7 @@ function activity_create_example() { try { $result = civicrm_api3('Activity', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Activity/ContactRefCustomFieldGet.ex.php b/api/v3/examples/Activity/ContactRefCustomFieldGet.ex.php index a2162e39c5..6141ee6b2f 100644 --- a/api/v3/examples/Activity/ContactRefCustomFieldGet.ex.php +++ b/api/v3/examples/Activity/ContactRefCustomFieldGet.ex.php @@ -21,7 +21,7 @@ function activity_get_example() { try { $result = civicrm_api3('Activity', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Activity/Create.ex.php b/api/v3/examples/Activity/Create.ex.php index 5a39798972..734f5fd106 100644 --- a/api/v3/examples/Activity/Create.ex.php +++ b/api/v3/examples/Activity/Create.ex.php @@ -27,7 +27,7 @@ function activity_create_example() { try { $result = civicrm_api3('Activity', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Activity/DateTimeHigh.ex.php b/api/v3/examples/Activity/DateTimeHigh.ex.php index 894484412a..c548c40eb7 100644 --- a/api/v3/examples/Activity/DateTimeHigh.ex.php +++ b/api/v3/examples/Activity/DateTimeHigh.ex.php @@ -23,7 +23,7 @@ function activity_get_example() { try { $result = civicrm_api3('Activity', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Activity/DateTimeLow.ex.php b/api/v3/examples/Activity/DateTimeLow.ex.php index fefd5cf63b..a3edbf46d1 100644 --- a/api/v3/examples/Activity/DateTimeLow.ex.php +++ b/api/v3/examples/Activity/DateTimeLow.ex.php @@ -22,7 +22,7 @@ function activity_get_example() { try { $result = civicrm_api3('Activity', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Activity/Delete.ex.php b/api/v3/examples/Activity/Delete.ex.php index fd6ebc4ba8..012d906baa 100644 --- a/api/v3/examples/Activity/Delete.ex.php +++ b/api/v3/examples/Activity/Delete.ex.php @@ -18,7 +18,7 @@ function activity_delete_example() { try { $result = civicrm_api3('Activity', 'delete', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Activity/Get.ex.php b/api/v3/examples/Activity/Get.ex.php index e09bac324e..8317521e9f 100644 --- a/api/v3/examples/Activity/Get.ex.php +++ b/api/v3/examples/Activity/Get.ex.php @@ -20,7 +20,7 @@ function activity_get_example() { try { $result = civicrm_api3('Activity', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Activity/GetFields.ex.php b/api/v3/examples/Activity/GetFields.ex.php index 465fa3e4f6..7800ac1d31 100644 --- a/api/v3/examples/Activity/GetFields.ex.php +++ b/api/v3/examples/Activity/GetFields.ex.php @@ -18,7 +18,7 @@ function activity_getfields_example() { try { $result = civicrm_api3('Activity', 'getfields', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Activity/GetTargetAndAssignee.ex.php b/api/v3/examples/Activity/GetTargetAndAssignee.ex.php index f9236211b3..2e62af1a5b 100644 --- a/api/v3/examples/Activity/GetTargetAndAssignee.ex.php +++ b/api/v3/examples/Activity/GetTargetAndAssignee.ex.php @@ -30,7 +30,7 @@ function activity_create_example() { try { $result = civicrm_api3('Activity', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Activity/GetTargetandAssigneeName.ex.php b/api/v3/examples/Activity/GetTargetandAssigneeName.ex.php index 8c40df7603..fa0f47211c 100644 --- a/api/v3/examples/Activity/GetTargetandAssigneeName.ex.php +++ b/api/v3/examples/Activity/GetTargetandAssigneeName.ex.php @@ -26,7 +26,7 @@ function activity_getsingle_example() { try { $result = civicrm_api3('Activity', 'getsingle', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Activity/ReturnAssigneeContact.ex.php b/api/v3/examples/Activity/ReturnAssigneeContact.ex.php index 1b4ce1121e..56eafffd28 100644 --- a/api/v3/examples/Activity/ReturnAssigneeContact.ex.php +++ b/api/v3/examples/Activity/ReturnAssigneeContact.ex.php @@ -29,7 +29,7 @@ function activity_get_example() { try { $result = civicrm_api3('Activity', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/ActivityContact/Create.ex.php b/api/v3/examples/ActivityContact/Create.ex.php index f3a9bf5037..925723407e 100644 --- a/api/v3/examples/ActivityContact/Create.ex.php +++ b/api/v3/examples/ActivityContact/Create.ex.php @@ -20,7 +20,7 @@ function activity_contact_create_example() { try { $result = civicrm_api3('ActivityContact', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/ActivityContact/Delete.ex.php b/api/v3/examples/ActivityContact/Delete.ex.php index dba912828e..e37958d6f1 100644 --- a/api/v3/examples/ActivityContact/Delete.ex.php +++ b/api/v3/examples/ActivityContact/Delete.ex.php @@ -18,7 +18,7 @@ function activity_contact_delete_example() { try { $result = civicrm_api3('ActivityContact', 'delete', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/ActivityType/Create.ex.php b/api/v3/examples/ActivityType/Create.ex.php index 43c02fd3c2..ca60925c1d 100644 --- a/api/v3/examples/ActivityType/Create.ex.php +++ b/api/v3/examples/ActivityType/Create.ex.php @@ -26,7 +26,7 @@ function activity_type_create_example() { try { $result = civicrm_api3('ActivityType', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/ActivityType/Get.ex.php b/api/v3/examples/ActivityType/Get.ex.php index eb3c704361..7ad7b6c026 100644 --- a/api/v3/examples/ActivityType/Get.ex.php +++ b/api/v3/examples/ActivityType/Get.ex.php @@ -19,7 +19,7 @@ function activity_type_get_example() { try { $result = civicrm_api3('ActivityType', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Address/AddressLike.ex.php b/api/v3/examples/Address/AddressLike.ex.php index 47dc4b85b0..a3cd6c204a 100644 --- a/api/v3/examples/Address/AddressLike.ex.php +++ b/api/v3/examples/Address/AddressLike.ex.php @@ -24,7 +24,7 @@ function address_get_example() { try { $result = civicrm_api3('Address', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Address/AddressParse.ex.php b/api/v3/examples/Address/AddressParse.ex.php index 6bac470ffc..8348056867 100644 --- a/api/v3/examples/Address/AddressParse.ex.php +++ b/api/v3/examples/Address/AddressParse.ex.php @@ -23,7 +23,7 @@ function address_create_example() { try { $result = civicrm_api3('Address', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Address/AddressSort.ex.php b/api/v3/examples/Address/AddressSort.ex.php index bde3f3d8af..377645a7f6 100644 --- a/api/v3/examples/Address/AddressSort.ex.php +++ b/api/v3/examples/Address/AddressSort.ex.php @@ -25,7 +25,7 @@ function address_get_example() { try { $result = civicrm_api3('Address', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Address/Create.ex.php b/api/v3/examples/Address/Create.ex.php index d3bacbe11a..5315e21774 100644 --- a/api/v3/examples/Address/Create.ex.php +++ b/api/v3/examples/Address/Create.ex.php @@ -25,7 +25,7 @@ function address_create_example() { try { $result = civicrm_api3('Address', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Address/Delete.ex.php b/api/v3/examples/Address/Delete.ex.php index e7e060a02e..b5583029df 100644 --- a/api/v3/examples/Address/Delete.ex.php +++ b/api/v3/examples/Address/Delete.ex.php @@ -18,7 +18,7 @@ function address_delete_example() { try { $result = civicrm_api3('Address', 'delete', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Address/Get.ex.php b/api/v3/examples/Address/Get.ex.php index d58398aeea..26de9b1fba 100644 --- a/api/v3/examples/Address/Get.ex.php +++ b/api/v3/examples/Address/Get.ex.php @@ -24,7 +24,7 @@ function address_get_example() { try { $result = civicrm_api3('Address', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Address/GetOptions.ex.php b/api/v3/examples/Address/GetOptions.ex.php index ae7090d658..15ca3de74b 100644 --- a/api/v3/examples/Address/GetOptions.ex.php +++ b/api/v3/examples/Address/GetOptions.ex.php @@ -18,7 +18,7 @@ function address_getoptions_example() { try { $result = civicrm_api3('Address', 'getoptions', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Batch/Create.ex.php b/api/v3/examples/Batch/Create.ex.php index 08457b0178..1148869837 100644 --- a/api/v3/examples/Batch/Create.ex.php +++ b/api/v3/examples/Batch/Create.ex.php @@ -23,7 +23,7 @@ function batch_create_example() { try { $result = civicrm_api3('Batch', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Batch/Delete.ex.php b/api/v3/examples/Batch/Delete.ex.php index 871e65756c..eb525d6271 100644 --- a/api/v3/examples/Batch/Delete.ex.php +++ b/api/v3/examples/Batch/Delete.ex.php @@ -18,7 +18,7 @@ function batch_delete_example() { try { $result = civicrm_api3('Batch', 'delete', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Batch/Get.ex.php b/api/v3/examples/Batch/Get.ex.php index 04a0f42c50..3c46694d2f 100644 --- a/api/v3/examples/Batch/Get.ex.php +++ b/api/v3/examples/Batch/Get.ex.php @@ -18,7 +18,7 @@ function batch_get_example() { try { $result = civicrm_api3('Batch', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Batch/Update.ex.php b/api/v3/examples/Batch/Update.ex.php index 0ee073de8d..aa1a825a55 100644 --- a/api/v3/examples/Batch/Update.ex.php +++ b/api/v3/examples/Batch/Update.ex.php @@ -23,7 +23,7 @@ function batch_update_example() { try { $result = civicrm_api3('batch', 'update', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Campaign/Create.ex.php b/api/v3/examples/Campaign/Create.ex.php index cf4ab0e714..70ec4f9881 100644 --- a/api/v3/examples/Campaign/Create.ex.php +++ b/api/v3/examples/Campaign/Create.ex.php @@ -23,7 +23,7 @@ function campaign_create_example() { try { $result = civicrm_api3('Campaign', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Campaign/Delete.ex.php b/api/v3/examples/Campaign/Delete.ex.php index 81a793590a..d828dc8d6f 100644 --- a/api/v3/examples/Campaign/Delete.ex.php +++ b/api/v3/examples/Campaign/Delete.ex.php @@ -18,7 +18,7 @@ function campaign_delete_example() { try { $result = civicrm_api3('Campaign', 'delete', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Campaign/Get.ex.php b/api/v3/examples/Campaign/Get.ex.php index 317e91a14f..c7e1c27982 100644 --- a/api/v3/examples/Campaign/Get.ex.php +++ b/api/v3/examples/Campaign/Get.ex.php @@ -20,7 +20,7 @@ function campaign_get_example() { try { $result = civicrm_api3('Campaign', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Case/Create.ex.php b/api/v3/examples/Case/Create.ex.php index b03342315c..6f3d1abfe0 100644 --- a/api/v3/examples/Case/Create.ex.php +++ b/api/v3/examples/Case/Create.ex.php @@ -21,7 +21,7 @@ function case_create_example() { try { $result = civicrm_api3('Case', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/CaseContact/Create.ex.php b/api/v3/examples/CaseContact/Create.ex.php index 495da74a84..b17fd8f5a3 100644 --- a/api/v3/examples/CaseContact/Create.ex.php +++ b/api/v3/examples/CaseContact/Create.ex.php @@ -19,7 +19,7 @@ function case_contact_create_example() { try { $result = civicrm_api3('CaseContact', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/CaseContact/Get.ex.php b/api/v3/examples/CaseContact/Get.ex.php index 0c8e042d3a..6cf38ad0ee 100644 --- a/api/v3/examples/CaseContact/Get.ex.php +++ b/api/v3/examples/CaseContact/Get.ex.php @@ -18,7 +18,7 @@ function case_contact_get_example() { try { $result = civicrm_api3('CaseContact', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Constant/Get.ex.php b/api/v3/examples/Constant/Get.ex.php index 67050d8770..2ac3a47dbc 100644 --- a/api/v3/examples/Constant/Get.ex.php +++ b/api/v3/examples/Constant/Get.ex.php @@ -21,7 +21,7 @@ function constant_get_example() { try { $result = civicrm_api3('Constant', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Contact/APIChainedArray.ex.php b/api/v3/examples/Contact/APIChainedArray.ex.php index 94a3e62c0c..9b27a5e7ac 100644 --- a/api/v3/examples/Contact/APIChainedArray.ex.php +++ b/api/v3/examples/Contact/APIChainedArray.ex.php @@ -27,7 +27,7 @@ function contact_get_example() { try { $result = civicrm_api3('Contact', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Contact/APIChainedArrayFormats.ex.php b/api/v3/examples/Contact/APIChainedArrayFormats.ex.php index 9590b7aa43..5e915fa949 100644 --- a/api/v3/examples/Contact/APIChainedArrayFormats.ex.php +++ b/api/v3/examples/Contact/APIChainedArrayFormats.ex.php @@ -28,7 +28,7 @@ function contact_get_example() { try { $result = civicrm_api3('Contact', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Contact/APIChainedArrayMultipleCustom.ex.php b/api/v3/examples/Contact/APIChainedArrayMultipleCustom.ex.php index 4bfd9fb6cf..f721e50ebe 100644 --- a/api/v3/examples/Contact/APIChainedArrayMultipleCustom.ex.php +++ b/api/v3/examples/Contact/APIChainedArrayMultipleCustom.ex.php @@ -25,7 +25,7 @@ function contact_get_example() { try { $result = civicrm_api3('Contact', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Contact/APIChainedArrayValuesFromSiblingFunction.ex.php b/api/v3/examples/Contact/APIChainedArrayValuesFromSiblingFunction.ex.php index 9ba497b712..93ba35e529 100644 --- a/api/v3/examples/Contact/APIChainedArrayValuesFromSiblingFunction.ex.php +++ b/api/v3/examples/Contact/APIChainedArrayValuesFromSiblingFunction.ex.php @@ -30,7 +30,7 @@ function contact_create_example() { try { $result = civicrm_api3('Contact', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Contact/ChainTwoWebsites.ex.php b/api/v3/examples/Contact/ChainTwoWebsites.ex.php index a4e5efa7ed..5901d1198f 100644 --- a/api/v3/examples/Contact/ChainTwoWebsites.ex.php +++ b/api/v3/examples/Contact/ChainTwoWebsites.ex.php @@ -43,7 +43,7 @@ function contact_create_example() { try { $result = civicrm_api3('Contact', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Contact/ChainTwoWebsitesSyntax2.ex.php b/api/v3/examples/Contact/ChainTwoWebsitesSyntax2.ex.php index 3a1596a8fe..fd4fc0240c 100644 --- a/api/v3/examples/Contact/ChainTwoWebsitesSyntax2.ex.php +++ b/api/v3/examples/Contact/ChainTwoWebsitesSyntax2.ex.php @@ -46,7 +46,7 @@ function contact_create_example() { try { $result = civicrm_api3('Contact', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Contact/ContactIDOfLoggedInUserContactAPI.ex.php b/api/v3/examples/Contact/ContactIDOfLoggedInUserContactAPI.ex.php index e0eeec276d..57ef407cec 100644 --- a/api/v3/examples/Contact/ContactIDOfLoggedInUserContactAPI.ex.php +++ b/api/v3/examples/Contact/ContactIDOfLoggedInUserContactAPI.ex.php @@ -20,7 +20,7 @@ function contact_get_example() { try { $result = civicrm_api3('Contact', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Contact/Create.ex.php b/api/v3/examples/Contact/Create.ex.php index cbf2a40d2c..7ed05c88a3 100644 --- a/api/v3/examples/Contact/Create.ex.php +++ b/api/v3/examples/Contact/Create.ex.php @@ -23,7 +23,7 @@ function contact_create_example() { try { $result = civicrm_api3('Contact', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Contact/CreateParticipantPayment.ex.php b/api/v3/examples/Contact/CreateParticipantPayment.ex.php index ba7bc66314..ccde534e69 100644 --- a/api/v3/examples/Contact/CreateParticipantPayment.ex.php +++ b/api/v3/examples/Contact/CreateParticipantPayment.ex.php @@ -37,7 +37,7 @@ function contact_create_example() { try { $result = civicrm_api3('Contact', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Contact/CustomFieldGet.ex.php b/api/v3/examples/Contact/CustomFieldGet.ex.php index 2f76fb669f..bac9895300 100644 --- a/api/v3/examples/Contact/CustomFieldGet.ex.php +++ b/api/v3/examples/Contact/CustomFieldGet.ex.php @@ -21,7 +21,7 @@ function contact_get_example() { try { $result = civicrm_api3('Contact', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Contact/CustomFieldGetReturnSyntaxVariation.ex.php b/api/v3/examples/Contact/CustomFieldGetReturnSyntaxVariation.ex.php index 6bb4a9bd8f..0c07d8763f 100644 --- a/api/v3/examples/Contact/CustomFieldGetReturnSyntaxVariation.ex.php +++ b/api/v3/examples/Contact/CustomFieldGetReturnSyntaxVariation.ex.php @@ -21,7 +21,7 @@ function contact_get_example() { try { $result = civicrm_api3('Contact', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Contact/Delete.ex.php b/api/v3/examples/Contact/Delete.ex.php index 5573cda036..5041f0ba82 100644 --- a/api/v3/examples/Contact/Delete.ex.php +++ b/api/v3/examples/Contact/Delete.ex.php @@ -18,7 +18,7 @@ function contact_delete_example() { try { $result = civicrm_api3('Contact', 'delete', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Contact/FormatIsSuccess_Fail.ex.php b/api/v3/examples/Contact/FormatIsSuccess_Fail.ex.php index addf2a22a9..b89dcd7dc9 100644 --- a/api/v3/examples/Contact/FormatIsSuccess_Fail.ex.php +++ b/api/v3/examples/Contact/FormatIsSuccess_Fail.ex.php @@ -22,7 +22,7 @@ function contact_create_example() { try { $result = civicrm_api3('Contact', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Contact/FormatIsSuccess_True.ex.php b/api/v3/examples/Contact/FormatIsSuccess_True.ex.php index 3672c1c116..8322e4af31 100644 --- a/api/v3/examples/Contact/FormatIsSuccess_True.ex.php +++ b/api/v3/examples/Contact/FormatIsSuccess_True.ex.php @@ -22,7 +22,7 @@ function contact_get_example() { try { $result = civicrm_api3('Contact', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Contact/FormatOnlyID.ex.php b/api/v3/examples/Contact/FormatOnlyID.ex.php index 9ed03e5d3f..215e1b3990 100644 --- a/api/v3/examples/Contact/FormatOnlyID.ex.php +++ b/api/v3/examples/Contact/FormatOnlyID.ex.php @@ -23,7 +23,7 @@ function contact_get_example() { try { $result = civicrm_api3('Contact', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Contact/FormatSingleValue.ex.php b/api/v3/examples/Contact/FormatSingleValue.ex.php index 59a30148f6..4ef40d85e2 100644 --- a/api/v3/examples/Contact/FormatSingleValue.ex.php +++ b/api/v3/examples/Contact/FormatSingleValue.ex.php @@ -23,7 +23,7 @@ function contact_getvalue_example() { try { $result = civicrm_api3('Contact', 'getvalue', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Contact/Get.ex.php b/api/v3/examples/Contact/Get.ex.php index 9e52194dcc..5ec0091920 100644 --- a/api/v3/examples/Contact/Get.ex.php +++ b/api/v3/examples/Contact/Get.ex.php @@ -18,7 +18,7 @@ function contact_get_example() { try { $result = civicrm_api3('Contact', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Contact/GetActions.ex.php b/api/v3/examples/Contact/GetActions.ex.php index 13c028b40d..d531d17f62 100644 --- a/api/v3/examples/Contact/GetActions.ex.php +++ b/api/v3/examples/Contact/GetActions.ex.php @@ -18,7 +18,7 @@ function contact_getactions_example() { try { $result = civicrm_api3('Contact', 'getactions', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Contact/GetCountContact.ex.php b/api/v3/examples/Contact/GetCountContact.ex.php index fcb9fd35c1..44e4562672 100644 --- a/api/v3/examples/Contact/GetCountContact.ex.php +++ b/api/v3/examples/Contact/GetCountContact.ex.php @@ -21,7 +21,7 @@ function contact_getcount_example() { try { $result = civicrm_api3('Contact', 'getcount', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Contact/GetFieldsOptions.ex.php b/api/v3/examples/Contact/GetFieldsOptions.ex.php index 1177b68ca4..04a81a4123 100644 --- a/api/v3/examples/Contact/GetFieldsOptions.ex.php +++ b/api/v3/examples/Contact/GetFieldsOptions.ex.php @@ -23,7 +23,7 @@ function contact_getfields_example() { try { $result = civicrm_api3('Contact', 'getfields', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Contact/GetMergedfrom.ex.php b/api/v3/examples/Contact/GetMergedfrom.ex.php index 7c3c477900..bab1e98219 100644 --- a/api/v3/examples/Contact/GetMergedfrom.ex.php +++ b/api/v3/examples/Contact/GetMergedfrom.ex.php @@ -18,7 +18,7 @@ function contact_getmergedfrom_example() { try { $result = civicrm_api3('Contact', 'getmergedfrom', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Contact/GetMergedto.ex.php b/api/v3/examples/Contact/GetMergedto.ex.php index 1b6c18da3f..4746b88c42 100644 --- a/api/v3/examples/Contact/GetMergedto.ex.php +++ b/api/v3/examples/Contact/GetMergedto.ex.php @@ -19,7 +19,7 @@ function contact_getmergedto_example() { try { $result = civicrm_api3('Contact', 'getmergedto', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Contact/GetOptions.ex.php b/api/v3/examples/Contact/GetOptions.ex.php index 75a7c9b937..b7e43de58f 100644 --- a/api/v3/examples/Contact/GetOptions.ex.php +++ b/api/v3/examples/Contact/GetOptions.ex.php @@ -20,7 +20,7 @@ function contact_getoptions_example() { try { $result = civicrm_api3('Contact', 'getoptions', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Contact/GetSingleContact.ex.php b/api/v3/examples/Contact/GetSingleContact.ex.php index 3992b4b438..12d9061f80 100644 --- a/api/v3/examples/Contact/GetSingleContact.ex.php +++ b/api/v3/examples/Contact/GetSingleContact.ex.php @@ -22,7 +22,7 @@ function contact_getsingle_example() { try { $result = civicrm_api3('Contact', 'getsingle', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Contact/GetUnique.ex.php b/api/v3/examples/Contact/GetUnique.ex.php index 44ddafecbf..e3f85e4062 100644 --- a/api/v3/examples/Contact/GetUnique.ex.php +++ b/api/v3/examples/Contact/GetUnique.ex.php @@ -16,7 +16,7 @@ function contact_getunique_example() { try { $result = civicrm_api3('Contact', 'getunique', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Contact/GroupFilterUsingContactAPI.ex.php b/api/v3/examples/Contact/GroupFilterUsingContactAPI.ex.php index 4e21725d1b..24a4154202 100644 --- a/api/v3/examples/Contact/GroupFilterUsingContactAPI.ex.php +++ b/api/v3/examples/Contact/GroupFilterUsingContactAPI.ex.php @@ -25,7 +25,7 @@ function contact_get_example() { try { $result = civicrm_api3('Contact', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Contact/NestedReplaceEmail.ex.php b/api/v3/examples/Contact/NestedReplaceEmail.ex.php index 8b443f1993..07c65f86ba 100644 --- a/api/v3/examples/Contact/NestedReplaceEmail.ex.php +++ b/api/v3/examples/Contact/NestedReplaceEmail.ex.php @@ -49,7 +49,7 @@ function contact_get_example() { try { $result = civicrm_api3('Contact', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Contribution/ContributionCreateWithHonoreeContact.ex.php b/api/v3/examples/Contribution/ContributionCreateWithHonoreeContact.ex.php index 8492f774c5..e56c890d5b 100644 --- a/api/v3/examples/Contribution/ContributionCreateWithHonoreeContact.ex.php +++ b/api/v3/examples/Contribution/ContributionCreateWithHonoreeContact.ex.php @@ -29,7 +29,7 @@ function contribution_create_example() { try { $result = civicrm_api3('Contribution', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Contribution/ContributionCreateWithNote.ex.php b/api/v3/examples/Contribution/ContributionCreateWithNote.ex.php index b0b2726779..44ec08c356 100644 --- a/api/v3/examples/Contribution/ContributionCreateWithNote.ex.php +++ b/api/v3/examples/Contribution/ContributionCreateWithNote.ex.php @@ -32,7 +32,7 @@ function contribution_create_example() { try { $result = civicrm_api3('Contribution', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Contribution/ContributionCreateWithSoftCredit.ex.php b/api/v3/examples/Contribution/ContributionCreateWithSoftCredit.ex.php index e6a60601cf..ea42d726df 100644 --- a/api/v3/examples/Contribution/ContributionCreateWithSoftCredit.ex.php +++ b/api/v3/examples/Contribution/ContributionCreateWithSoftCredit.ex.php @@ -35,7 +35,7 @@ function contribution_create_example() { try { $result = civicrm_api3('Contribution', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Contribution/ContributionCreateWithSoftCreditDefaults.ex.php b/api/v3/examples/Contribution/ContributionCreateWithSoftCreditDefaults.ex.php index 86686dbd23..938f989bc5 100644 --- a/api/v3/examples/Contribution/ContributionCreateWithSoftCreditDefaults.ex.php +++ b/api/v3/examples/Contribution/ContributionCreateWithSoftCreditDefaults.ex.php @@ -29,7 +29,7 @@ function contribution_create_example() { try { $result = civicrm_api3('Contribution', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Contribution/Create.ex.php b/api/v3/examples/Contribution/Create.ex.php index 557102d48c..f275e817e5 100644 --- a/api/v3/examples/Contribution/Create.ex.php +++ b/api/v3/examples/Contribution/Create.ex.php @@ -27,7 +27,7 @@ function contribution_create_example() { try { $result = civicrm_api3('Contribution', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Contribution/CreateWithNestedLineItems.ex.php b/api/v3/examples/Contribution/CreateWithNestedLineItems.ex.php index efdc4e3b05..6324494bd3 100644 --- a/api/v3/examples/Contribution/CreateWithNestedLineItems.ex.php +++ b/api/v3/examples/Contribution/CreateWithNestedLineItems.ex.php @@ -46,7 +46,7 @@ function contribution_create_example() { try { $result = civicrm_api3('Contribution', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Contribution/Delete.ex.php b/api/v3/examples/Contribution/Delete.ex.php index abb478aa67..995946cd03 100644 --- a/api/v3/examples/Contribution/Delete.ex.php +++ b/api/v3/examples/Contribution/Delete.ex.php @@ -18,7 +18,7 @@ function contribution_delete_example() { try { $result = civicrm_api3('Contribution', 'delete', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Contribution/Get.ex.php b/api/v3/examples/Contribution/Get.ex.php index 28fd89ea34..aa60007bb2 100644 --- a/api/v3/examples/Contribution/Get.ex.php +++ b/api/v3/examples/Contribution/Get.ex.php @@ -33,7 +33,7 @@ function contribution_get_example() { try { $result = civicrm_api3('Contribution', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Contribution/GetUnique.ex.php b/api/v3/examples/Contribution/GetUnique.ex.php index 7f72533307..01aa735930 100644 --- a/api/v3/examples/Contribution/GetUnique.ex.php +++ b/api/v3/examples/Contribution/GetUnique.ex.php @@ -16,7 +16,7 @@ function contribution_getunique_example() { try { $result = civicrm_api3('Contribution', 'getunique', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/ContributionPage/Create.ex.php b/api/v3/examples/ContributionPage/Create.ex.php index e795e70212..2070e71044 100644 --- a/api/v3/examples/ContributionPage/Create.ex.php +++ b/api/v3/examples/ContributionPage/Create.ex.php @@ -27,7 +27,7 @@ function contribution_page_create_example() { try { $result = civicrm_api3('ContributionPage', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/ContributionPage/Delete.ex.php b/api/v3/examples/ContributionPage/Delete.ex.php index 831bbafc71..babbd43ca0 100644 --- a/api/v3/examples/ContributionPage/Delete.ex.php +++ b/api/v3/examples/ContributionPage/Delete.ex.php @@ -18,7 +18,7 @@ function contribution_page_delete_example() { try { $result = civicrm_api3('ContributionPage', 'delete', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/ContributionPage/Get.ex.php b/api/v3/examples/ContributionPage/Get.ex.php index bfc747f45c..46acb7e857 100644 --- a/api/v3/examples/ContributionPage/Get.ex.php +++ b/api/v3/examples/ContributionPage/Get.ex.php @@ -19,7 +19,7 @@ function contribution_page_get_example() { try { $result = civicrm_api3('ContributionPage', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/ContributionPage/Submit.ex.php b/api/v3/examples/ContributionPage/Submit.ex.php index 1b3f68bd3c..f1eb5c13c8 100644 --- a/api/v3/examples/ContributionPage/Submit.ex.php +++ b/api/v3/examples/ContributionPage/Submit.ex.php @@ -41,7 +41,7 @@ function contribution_page_submit_example() { try { $result = civicrm_api3('ContributionPage', 'submit', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/ContributionRecur/Create.ex.php b/api/v3/examples/ContributionRecur/Create.ex.php index 6843dbf101..d4029781aa 100644 --- a/api/v3/examples/ContributionRecur/Create.ex.php +++ b/api/v3/examples/ContributionRecur/Create.ex.php @@ -25,7 +25,7 @@ function contribution_recur_create_example() { try { $result = civicrm_api3('ContributionRecur', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/ContributionRecur/Delete.ex.php b/api/v3/examples/ContributionRecur/Delete.ex.php index 8f36284965..1d4b11c403 100644 --- a/api/v3/examples/ContributionRecur/Delete.ex.php +++ b/api/v3/examples/ContributionRecur/Delete.ex.php @@ -18,7 +18,7 @@ function contribution_recur_delete_example() { try { $result = civicrm_api3('ContributionRecur', 'delete', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/ContributionRecur/Get.ex.php b/api/v3/examples/ContributionRecur/Get.ex.php index 38caa084ea..a26894fc44 100644 --- a/api/v3/examples/ContributionRecur/Get.ex.php +++ b/api/v3/examples/ContributionRecur/Get.ex.php @@ -18,7 +18,7 @@ function contribution_recur_get_example() { try { $result = civicrm_api3('ContributionRecur', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/ContributionSoft/Create.ex.php b/api/v3/examples/ContributionSoft/Create.ex.php index 9a95fe6eae..b90e7cbead 100644 --- a/api/v3/examples/ContributionSoft/Create.ex.php +++ b/api/v3/examples/ContributionSoft/Create.ex.php @@ -22,7 +22,7 @@ function contribution_soft_create_example() { try { $result = civicrm_api3('ContributionSoft', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/ContributionSoft/Delete.ex.php b/api/v3/examples/ContributionSoft/Delete.ex.php index 02c4265afc..967a0891cf 100644 --- a/api/v3/examples/ContributionSoft/Delete.ex.php +++ b/api/v3/examples/ContributionSoft/Delete.ex.php @@ -18,7 +18,7 @@ function contribution_soft_delete_example() { try { $result = civicrm_api3('ContributionSoft', 'delete', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/ContributionSoft/Get.ex.php b/api/v3/examples/ContributionSoft/Get.ex.php index 26dadff3b4..49ea3c8c04 100644 --- a/api/v3/examples/ContributionSoft/Get.ex.php +++ b/api/v3/examples/ContributionSoft/Get.ex.php @@ -18,7 +18,7 @@ function contribution_soft_get_example() { try { $result = civicrm_api3('ContributionSoft', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Country/Create.ex.php b/api/v3/examples/Country/Create.ex.php index 9897b2c57f..8443fc2d9e 100644 --- a/api/v3/examples/Country/Create.ex.php +++ b/api/v3/examples/Country/Create.ex.php @@ -20,7 +20,7 @@ function country_create_example() { try { $result = civicrm_api3('Country', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Country/Delete.ex.php b/api/v3/examples/Country/Delete.ex.php index 07c01d631a..f7b33b0c5a 100644 --- a/api/v3/examples/Country/Delete.ex.php +++ b/api/v3/examples/Country/Delete.ex.php @@ -18,7 +18,7 @@ function country_delete_example() { try { $result = civicrm_api3('Country', 'delete', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Country/Get.ex.php b/api/v3/examples/Country/Get.ex.php index bef86bf4a9..83e3d119a2 100644 --- a/api/v3/examples/Country/Get.ex.php +++ b/api/v3/examples/Country/Get.ex.php @@ -18,7 +18,7 @@ function country_get_example() { try { $result = civicrm_api3('Country', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/CustomField/Create.ex.php b/api/v3/examples/CustomField/Create.ex.php index ed02778eee..b4bb9124eb 100644 --- a/api/v3/examples/CustomField/Create.ex.php +++ b/api/v3/examples/CustomField/Create.ex.php @@ -27,7 +27,7 @@ function custom_field_create_example() { try { $result = civicrm_api3('CustomField', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/CustomField/Delete.ex.php b/api/v3/examples/CustomField/Delete.ex.php index 70a300f970..9b5ff15d59 100644 --- a/api/v3/examples/CustomField/Delete.ex.php +++ b/api/v3/examples/CustomField/Delete.ex.php @@ -18,7 +18,7 @@ function custom_field_delete_example() { try { $result = civicrm_api3('CustomField', 'delete', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/CustomGroup/Create.ex.php b/api/v3/examples/CustomGroup/Create.ex.php index a0b4a0ff8a..f965296441 100644 --- a/api/v3/examples/CustomGroup/Create.ex.php +++ b/api/v3/examples/CustomGroup/Create.ex.php @@ -28,7 +28,7 @@ function custom_group_create_example() { try { $result = civicrm_api3('CustomGroup', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/CustomGroup/Delete.ex.php b/api/v3/examples/CustomGroup/Delete.ex.php index 235dee9161..d495a48aa6 100644 --- a/api/v3/examples/CustomGroup/Delete.ex.php +++ b/api/v3/examples/CustomGroup/Delete.ex.php @@ -18,7 +18,7 @@ function custom_group_delete_example() { try { $result = civicrm_api3('CustomGroup', 'delete', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/CustomGroup/Get.ex.php b/api/v3/examples/CustomGroup/Get.ex.php index 1ad72fa5d5..f40211ba22 100644 --- a/api/v3/examples/CustomGroup/Get.ex.php +++ b/api/v3/examples/CustomGroup/Get.ex.php @@ -16,7 +16,7 @@ function custom_group_get_example() { try { $result = civicrm_api3('CustomGroup', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/CustomValue/Create.ex.php b/api/v3/examples/CustomValue/Create.ex.php index 4b2ca0b56f..930ddf9f92 100644 --- a/api/v3/examples/CustomValue/Create.ex.php +++ b/api/v3/examples/CustomValue/Create.ex.php @@ -19,7 +19,7 @@ function custom_value_create_example() { try { $result = civicrm_api3('CustomValue', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/CustomValue/FormatFieldName.ex.php b/api/v3/examples/CustomValue/FormatFieldName.ex.php index 9918a76d4d..e353390380 100644 --- a/api/v3/examples/CustomValue/FormatFieldName.ex.php +++ b/api/v3/examples/CustomValue/FormatFieldName.ex.php @@ -22,7 +22,7 @@ function custom_value_get_example() { try { $result = civicrm_api3('CustomValue', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/CustomValue/Get.ex.php b/api/v3/examples/CustomValue/Get.ex.php index 77fa73348d..b5eae03648 100644 --- a/api/v3/examples/CustomValue/Get.ex.php +++ b/api/v3/examples/CustomValue/Get.ex.php @@ -21,7 +21,7 @@ function custom_value_get_example() { try { $result = civicrm_api3('CustomValue', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Domain/Create.ex.php b/api/v3/examples/Domain/Create.ex.php index f4bbe211fc..be9c1708af 100644 --- a/api/v3/examples/Domain/Create.ex.php +++ b/api/v3/examples/Domain/Create.ex.php @@ -21,7 +21,7 @@ function domain_create_example() { try { $result = civicrm_api3('Domain', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Domain/Get.ex.php b/api/v3/examples/Domain/Get.ex.php index 0c8e4382dc..54652a3bc4 100644 --- a/api/v3/examples/Domain/Get.ex.php +++ b/api/v3/examples/Domain/Get.ex.php @@ -18,7 +18,7 @@ function domain_get_example() { try { $result = civicrm_api3('Domain', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Email/Create.ex.php b/api/v3/examples/Email/Create.ex.php index 65c563a7e5..7b793b185f 100644 --- a/api/v3/examples/Email/Create.ex.php +++ b/api/v3/examples/Email/Create.ex.php @@ -20,7 +20,7 @@ function email_create_example() { try { $result = civicrm_api3('Email', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Email/Delete.ex.php b/api/v3/examples/Email/Delete.ex.php index b2bb3c5ba5..a0152c8841 100644 --- a/api/v3/examples/Email/Delete.ex.php +++ b/api/v3/examples/Email/Delete.ex.php @@ -18,7 +18,7 @@ function email_delete_example() { try { $result = civicrm_api3('Email', 'delete', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Email/Replace.ex.php b/api/v3/examples/Email/Replace.ex.php index 075ed52e6f..42a949cdb9 100644 --- a/api/v3/examples/Email/Replace.ex.php +++ b/api/v3/examples/Email/Replace.ex.php @@ -45,7 +45,7 @@ function email_replace_example() { try { $result = civicrm_api3('Email', 'replace', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/EntityBatch/Create.ex.php b/api/v3/examples/EntityBatch/Create.ex.php index 540e1ba5ba..f0a3c13095 100644 --- a/api/v3/examples/EntityBatch/Create.ex.php +++ b/api/v3/examples/EntityBatch/Create.ex.php @@ -20,7 +20,7 @@ function entity_batch_create_example() { try { $result = civicrm_api3('EntityBatch', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/EntityBatch/Delete.ex.php b/api/v3/examples/EntityBatch/Delete.ex.php index 1dac21e44b..d614b19fd4 100644 --- a/api/v3/examples/EntityBatch/Delete.ex.php +++ b/api/v3/examples/EntityBatch/Delete.ex.php @@ -18,7 +18,7 @@ function entity_batch_delete_example() { try { $result = civicrm_api3('EntityBatch', 'delete', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/EntityBatch/Get.ex.php b/api/v3/examples/EntityBatch/Get.ex.php index ce46614cce..0adac2b07c 100644 --- a/api/v3/examples/EntityBatch/Get.ex.php +++ b/api/v3/examples/EntityBatch/Get.ex.php @@ -20,7 +20,7 @@ function entity_batch_get_example() { try { $result = civicrm_api3('EntityBatch', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/EntityTag/Create.ex.php b/api/v3/examples/EntityTag/Create.ex.php index 986ecfbfe3..18bb68026a 100644 --- a/api/v3/examples/EntityTag/Create.ex.php +++ b/api/v3/examples/EntityTag/Create.ex.php @@ -19,7 +19,7 @@ function entity_tag_create_example() { try { $result = civicrm_api3('EntityTag', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/EntityTag/Delete.ex.php b/api/v3/examples/EntityTag/Delete.ex.php index f2a4915a9f..f871a3da65 100644 --- a/api/v3/examples/EntityTag/Delete.ex.php +++ b/api/v3/examples/EntityTag/Delete.ex.php @@ -19,7 +19,7 @@ function entity_tag_delete_example() { try { $result = civicrm_api3('EntityTag', 'delete', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/EntityTag/Get.ex.php b/api/v3/examples/EntityTag/Get.ex.php index d47ccee808..6d139a4554 100644 --- a/api/v3/examples/EntityTag/Get.ex.php +++ b/api/v3/examples/EntityTag/Get.ex.php @@ -18,7 +18,7 @@ function entity_tag_get_example() { try { $result = civicrm_api3('EntityTag', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Event/ContactRefCustomField.ex.php b/api/v3/examples/Event/ContactRefCustomField.ex.php index 419ae61b83..d2a5d1db6c 100644 --- a/api/v3/examples/Event/ContactRefCustomField.ex.php +++ b/api/v3/examples/Event/ContactRefCustomField.ex.php @@ -21,7 +21,7 @@ function event_get_example() { try { $result = civicrm_api3('Event', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Event/Create.ex.php b/api/v3/examples/Event/Create.ex.php index 52c0858b00..b2bc9d0b11 100644 --- a/api/v3/examples/Event/Create.ex.php +++ b/api/v3/examples/Event/Create.ex.php @@ -32,7 +32,7 @@ function event_create_example() { try { $result = civicrm_api3('Event', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Event/Delete.ex.php b/api/v3/examples/Event/Delete.ex.php index e266391226..8e3f6cb209 100644 --- a/api/v3/examples/Event/Delete.ex.php +++ b/api/v3/examples/Event/Delete.ex.php @@ -18,7 +18,7 @@ function event_delete_example() { try { $result = civicrm_api3('Event', 'delete', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Event/Get.ex.php b/api/v3/examples/Event/Get.ex.php index bb24a02302..921ab12aac 100644 --- a/api/v3/examples/Event/Get.ex.php +++ b/api/v3/examples/Event/Get.ex.php @@ -19,7 +19,7 @@ function event_get_example() { try { $result = civicrm_api3('Event', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Event/IsCurrentOption.ex.php b/api/v3/examples/Event/IsCurrentOption.ex.php index c094ec7ff5..0df7671851 100644 --- a/api/v3/examples/Event/IsCurrentOption.ex.php +++ b/api/v3/examples/Event/IsCurrentOption.ex.php @@ -20,7 +20,7 @@ function event_get_example() { try { $result = civicrm_api3('Event', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Event/IsFullOption.ex.php b/api/v3/examples/Event/IsFullOption.ex.php index 747a6bd30a..cf874bb64d 100644 --- a/api/v3/examples/Event/IsFullOption.ex.php +++ b/api/v3/examples/Event/IsFullOption.ex.php @@ -21,7 +21,7 @@ function event_getsingle_example() { try { $result = civicrm_api3('Event', 'getsingle', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Grant/Create.ex.php b/api/v3/examples/Grant/Create.ex.php index e48884fdad..615ec933eb 100644 --- a/api/v3/examples/Grant/Create.ex.php +++ b/api/v3/examples/Grant/Create.ex.php @@ -25,7 +25,7 @@ function grant_create_example() { try { $result = civicrm_api3('Grant', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Grant/Delete.ex.php b/api/v3/examples/Grant/Delete.ex.php index f214c55fbd..36a2200d40 100644 --- a/api/v3/examples/Grant/Delete.ex.php +++ b/api/v3/examples/Grant/Delete.ex.php @@ -18,7 +18,7 @@ function grant_delete_example() { try { $result = civicrm_api3('Grant', 'delete', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Grant/Get.ex.php b/api/v3/examples/Grant/Get.ex.php index 0516eec65f..3a95377fa9 100644 --- a/api/v3/examples/Grant/Get.ex.php +++ b/api/v3/examples/Grant/Get.ex.php @@ -18,7 +18,7 @@ function grant_get_example() { try { $result = civicrm_api3('Grant', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Group/Get.ex.php b/api/v3/examples/Group/Get.ex.php index fb92e045cc..737e90b4e3 100644 --- a/api/v3/examples/Group/Get.ex.php +++ b/api/v3/examples/Group/Get.ex.php @@ -18,7 +18,7 @@ function group_get_example() { try { $result = civicrm_api3('Group', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Group/GetFields.ex.php b/api/v3/examples/Group/GetFields.ex.php index dcdb68a608..3a357d6903 100644 --- a/api/v3/examples/Group/GetFields.ex.php +++ b/api/v3/examples/Group/GetFields.ex.php @@ -20,7 +20,7 @@ function group_getfields_example() { try { $result = civicrm_api3('Group', 'getfields', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/GroupContact/Create.ex.php b/api/v3/examples/GroupContact/Create.ex.php index e60ffc8bd5..ab4683ff29 100644 --- a/api/v3/examples/GroupContact/Create.ex.php +++ b/api/v3/examples/GroupContact/Create.ex.php @@ -20,7 +20,7 @@ function group_contact_create_example() { try { $result = civicrm_api3('GroupContact', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/GroupContact/Delete.ex.php b/api/v3/examples/GroupContact/Delete.ex.php index 590ea6f515..4ae8dd7062 100644 --- a/api/v3/examples/GroupContact/Delete.ex.php +++ b/api/v3/examples/GroupContact/Delete.ex.php @@ -19,7 +19,7 @@ function group_contact_delete_example() { try { $result = civicrm_api3('GroupContact', 'delete', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/GroupContact/Get.ex.php b/api/v3/examples/GroupContact/Get.ex.php index 823559f8d4..3635d4c692 100644 --- a/api/v3/examples/GroupContact/Get.ex.php +++ b/api/v3/examples/GroupContact/Get.ex.php @@ -18,7 +18,7 @@ function group_contact_get_example() { try { $result = civicrm_api3('GroupContact', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/GroupContact/GetWithGroupID.ex.php b/api/v3/examples/GroupContact/GetWithGroupID.ex.php index 113a76de57..7009d244b4 100644 --- a/api/v3/examples/GroupContact/GetWithGroupID.ex.php +++ b/api/v3/examples/GroupContact/GetWithGroupID.ex.php @@ -22,7 +22,7 @@ function group_contact_get_example() { try { $result = civicrm_api3('GroupContact', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/GroupNesting/Create.ex.php b/api/v3/examples/GroupNesting/Create.ex.php index 2f2d7268a6..40197d2b30 100644 --- a/api/v3/examples/GroupNesting/Create.ex.php +++ b/api/v3/examples/GroupNesting/Create.ex.php @@ -19,7 +19,7 @@ function group_nesting_create_example() { try { $result = civicrm_api3('GroupNesting', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/GroupNesting/Delete.ex.php b/api/v3/examples/GroupNesting/Delete.ex.php index 536ac38d64..a99389bbb9 100644 --- a/api/v3/examples/GroupNesting/Delete.ex.php +++ b/api/v3/examples/GroupNesting/Delete.ex.php @@ -18,7 +18,7 @@ function group_nesting_delete_example() { try { $result = civicrm_api3('GroupNesting', 'delete', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/GroupNesting/Get.ex.php b/api/v3/examples/GroupNesting/Get.ex.php index 1625e8bb7e..7f12e6123a 100644 --- a/api/v3/examples/GroupNesting/Get.ex.php +++ b/api/v3/examples/GroupNesting/Get.ex.php @@ -19,7 +19,7 @@ function group_nesting_get_example() { try { $result = civicrm_api3('GroupNesting', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/GroupOrganization/Create.ex.php b/api/v3/examples/GroupOrganization/Create.ex.php index 63552d4da8..e27bc46e97 100644 --- a/api/v3/examples/GroupOrganization/Create.ex.php +++ b/api/v3/examples/GroupOrganization/Create.ex.php @@ -19,7 +19,7 @@ function group_organization_create_example() { try { $result = civicrm_api3('GroupOrganization', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/GroupOrganization/Delete.ex.php b/api/v3/examples/GroupOrganization/Delete.ex.php index e84acd361f..3f87163026 100644 --- a/api/v3/examples/GroupOrganization/Delete.ex.php +++ b/api/v3/examples/GroupOrganization/Delete.ex.php @@ -18,7 +18,7 @@ function group_organization_delete_example() { try { $result = civicrm_api3('GroupOrganization', 'delete', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/GroupOrganization/Get.ex.php b/api/v3/examples/GroupOrganization/Get.ex.php index c0ef24fa35..c962c50914 100644 --- a/api/v3/examples/GroupOrganization/Get.ex.php +++ b/api/v3/examples/GroupOrganization/Get.ex.php @@ -18,7 +18,7 @@ function group_organization_get_example() { try { $result = civicrm_api3('GroupOrganization', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Im/Create.ex.php b/api/v3/examples/Im/Create.ex.php index 03af0f6cae..2a47feb628 100644 --- a/api/v3/examples/Im/Create.ex.php +++ b/api/v3/examples/Im/Create.ex.php @@ -20,7 +20,7 @@ function im_create_example() { try { $result = civicrm_api3('Im', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Im/Delete.ex.php b/api/v3/examples/Im/Delete.ex.php index d2f5e2a4ca..5094e1c253 100644 --- a/api/v3/examples/Im/Delete.ex.php +++ b/api/v3/examples/Im/Delete.ex.php @@ -18,7 +18,7 @@ function im_delete_example() { try { $result = civicrm_api3('Im', 'delete', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Im/Get.ex.php b/api/v3/examples/Im/Get.ex.php index dd611a3818..9da151891b 100644 --- a/api/v3/examples/Im/Get.ex.php +++ b/api/v3/examples/Im/Get.ex.php @@ -21,7 +21,7 @@ function im_get_example() { try { $result = civicrm_api3('Im', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Job/Clone.ex.php b/api/v3/examples/Job/Clone.ex.php index aad91cb682..5757ab43a4 100644 --- a/api/v3/examples/Job/Clone.ex.php +++ b/api/v3/examples/Job/Clone.ex.php @@ -18,7 +18,7 @@ function job_clone_example() { try { $result = civicrm_api3('Job', 'clone', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Job/Create.ex.php b/api/v3/examples/Job/Create.ex.php index f022cce7d9..605b9cc9ab 100644 --- a/api/v3/examples/Job/Create.ex.php +++ b/api/v3/examples/Job/Create.ex.php @@ -25,7 +25,7 @@ function job_create_example() { try { $result = civicrm_api3('Job', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Job/Delete.ex.php b/api/v3/examples/Job/Delete.ex.php index 995e8654eb..2f6dd94003 100644 --- a/api/v3/examples/Job/Delete.ex.php +++ b/api/v3/examples/Job/Delete.ex.php @@ -18,7 +18,7 @@ function job_delete_example() { try { $result = civicrm_api3('Job', 'delete', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/LineItem/Create.ex.php b/api/v3/examples/LineItem/Create.ex.php index a3e8a21044..11eb298ce9 100644 --- a/api/v3/examples/LineItem/Create.ex.php +++ b/api/v3/examples/LineItem/Create.ex.php @@ -24,7 +24,7 @@ function line_item_create_example() { try { $result = civicrm_api3('LineItem', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/LineItem/Delete.ex.php b/api/v3/examples/LineItem/Delete.ex.php index 21b035602e..c8cedafc79 100644 --- a/api/v3/examples/LineItem/Delete.ex.php +++ b/api/v3/examples/LineItem/Delete.ex.php @@ -18,7 +18,7 @@ function line_item_delete_example() { try { $result = civicrm_api3('LineItem', 'delete', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/LineItem/Get.ex.php b/api/v3/examples/LineItem/Get.ex.php index 1feccf9180..6fcebcea17 100644 --- a/api/v3/examples/LineItem/Get.ex.php +++ b/api/v3/examples/LineItem/Get.ex.php @@ -18,7 +18,7 @@ function line_item_get_example() { try { $result = civicrm_api3('LineItem', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/LocBlock/Create.ex.php b/api/v3/examples/LocBlock/Create.ex.php index 5d3ef0aa20..b30a85cdcd 100644 --- a/api/v3/examples/LocBlock/Create.ex.php +++ b/api/v3/examples/LocBlock/Create.ex.php @@ -22,7 +22,7 @@ function loc_block_create_example() { try { $result = civicrm_api3('LocBlock', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/LocBlock/CreateEntities.ex.php b/api/v3/examples/LocBlock/CreateEntities.ex.php index 17ceb410e3..9b2d00d2b6 100644 --- a/api/v3/examples/LocBlock/CreateEntities.ex.php +++ b/api/v3/examples/LocBlock/CreateEntities.ex.php @@ -35,7 +35,7 @@ function loc_block_create_example() { try { $result = civicrm_api3('LocBlock', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/LocBlock/Get.ex.php b/api/v3/examples/LocBlock/Get.ex.php index 338cc385f4..67e14158aa 100644 --- a/api/v3/examples/LocBlock/Get.ex.php +++ b/api/v3/examples/LocBlock/Get.ex.php @@ -21,7 +21,7 @@ function loc_block_get_example() { try { $result = civicrm_api3('LocBlock', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Logging/Get.ex.php b/api/v3/examples/Logging/Get.ex.php index 28484e4b58..f5431e58cc 100644 --- a/api/v3/examples/Logging/Get.ex.php +++ b/api/v3/examples/Logging/Get.ex.php @@ -18,7 +18,7 @@ function logging_get_example() { try { $result = civicrm_api3('Logging', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Logging/Revert.ex.php b/api/v3/examples/Logging/Revert.ex.php index 59c11fff93..b7e1100024 100644 --- a/api/v3/examples/Logging/Revert.ex.php +++ b/api/v3/examples/Logging/Revert.ex.php @@ -19,7 +19,7 @@ function logging_revert_example() { try { $result = civicrm_api3('Logging', 'revert', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/MailSettings/ChainedGetDelete.ex.php b/api/v3/examples/MailSettings/ChainedGetDelete.ex.php index 8dd2b35d5a..df398954ea 100644 --- a/api/v3/examples/MailSettings/ChainedGetDelete.ex.php +++ b/api/v3/examples/MailSettings/ChainedGetDelete.ex.php @@ -21,7 +21,7 @@ function mail_settings_get_example() { try { $result = civicrm_api3('MailSettings', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/MailSettings/Create.ex.php b/api/v3/examples/MailSettings/Create.ex.php index 12357ea680..a30d8c86b0 100644 --- a/api/v3/examples/MailSettings/Create.ex.php +++ b/api/v3/examples/MailSettings/Create.ex.php @@ -25,7 +25,7 @@ function mail_settings_create_example() { try { $result = civicrm_api3('MailSettings', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/MailSettings/Delete.ex.php b/api/v3/examples/MailSettings/Delete.ex.php index 87945c6be8..e2dc25648d 100644 --- a/api/v3/examples/MailSettings/Delete.ex.php +++ b/api/v3/examples/MailSettings/Delete.ex.php @@ -18,7 +18,7 @@ function mail_settings_delete_example() { try { $result = civicrm_api3('MailSettings', 'delete', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/MailSettings/Get.ex.php b/api/v3/examples/MailSettings/Get.ex.php index b007e786e2..14ff9fe1df 100644 --- a/api/v3/examples/MailSettings/Get.ex.php +++ b/api/v3/examples/MailSettings/Get.ex.php @@ -25,7 +25,7 @@ function mail_settings_get_example() { try { $result = civicrm_api3('MailSettings', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/MailSettings/GetOptions.ex.php b/api/v3/examples/MailSettings/GetOptions.ex.php index 95ed1c3c3d..75d359bae0 100644 --- a/api/v3/examples/MailSettings/GetOptions.ex.php +++ b/api/v3/examples/MailSettings/GetOptions.ex.php @@ -18,7 +18,7 @@ function mail_settings_getoptions_example() { try { $result = civicrm_api3('MailSettings', 'getoptions', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Mailing/Clone.ex.php b/api/v3/examples/Mailing/Clone.ex.php index fd9ebc16e6..b06c69136a 100644 --- a/api/v3/examples/Mailing/Clone.ex.php +++ b/api/v3/examples/Mailing/Clone.ex.php @@ -18,7 +18,7 @@ function mailing_clone_example() { try { $result = civicrm_api3('Mailing', 'clone', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Mailing/Create.ex.php b/api/v3/examples/Mailing/Create.ex.php index b02fd78d14..4ecddd8645 100644 --- a/api/v3/examples/Mailing/Create.ex.php +++ b/api/v3/examples/Mailing/Create.ex.php @@ -50,7 +50,7 @@ https://civicrm.org try { $result = civicrm_api3('Mailing', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Mailing/Delete.ex.php b/api/v3/examples/Mailing/Delete.ex.php index 9e3f5abaf9..511eff7e1b 100644 --- a/api/v3/examples/Mailing/Delete.ex.php +++ b/api/v3/examples/Mailing/Delete.ex.php @@ -18,7 +18,7 @@ function mailing_delete_example() { try { $result = civicrm_api3('Mailing', 'delete', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Mailing/GetTokens.ex.php b/api/v3/examples/Mailing/GetTokens.ex.php index e14c23409b..5b39bb7dd5 100644 --- a/api/v3/examples/Mailing/GetTokens.ex.php +++ b/api/v3/examples/Mailing/GetTokens.ex.php @@ -24,7 +24,7 @@ function mailing_gettokens_example() { try { $result = civicrm_api3('Mailing', 'gettokens', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Mailing/Submit.ex.php b/api/v3/examples/Mailing/Submit.ex.php index 067a0ebf23..b2bf20e4d9 100644 --- a/api/v3/examples/Mailing/Submit.ex.php +++ b/api/v3/examples/Mailing/Submit.ex.php @@ -20,7 +20,7 @@ function mailing_submit_example() { try { $result = civicrm_api3('Mailing', 'submit', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/MailingAB/Create.ex.php b/api/v3/examples/MailingAB/Create.ex.php index 8064520b84..6a287beb8d 100644 --- a/api/v3/examples/MailingAB/Create.ex.php +++ b/api/v3/examples/MailingAB/Create.ex.php @@ -24,7 +24,7 @@ function mailing_a_b_create_example() { try { $result = civicrm_api3('MailingAB', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/MailingEventSubscribe/Create.ex.php b/api/v3/examples/MailingEventSubscribe/Create.ex.php index c466adee7b..9059f57df9 100644 --- a/api/v3/examples/MailingEventSubscribe/Create.ex.php +++ b/api/v3/examples/MailingEventSubscribe/Create.ex.php @@ -22,7 +22,7 @@ function mailing_event_subscribe_create_example() { try { $result = civicrm_api3('MailingEventSubscribe', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/MailingGroup/Subscribe.ex.php b/api/v3/examples/MailingGroup/Subscribe.ex.php index bfe0799b37..df4f96729b 100644 --- a/api/v3/examples/MailingGroup/Subscribe.ex.php +++ b/api/v3/examples/MailingGroup/Subscribe.ex.php @@ -22,7 +22,7 @@ function mailing_group_subscribe_example() { try { $result = civicrm_api3('mailing_group', 'subscribe', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Mapping/Create.ex.php b/api/v3/examples/Mapping/Create.ex.php index 630db22863..c3ebff0aee 100644 --- a/api/v3/examples/Mapping/Create.ex.php +++ b/api/v3/examples/Mapping/Create.ex.php @@ -20,7 +20,7 @@ function mapping_create_example() { try { $result = civicrm_api3('Mapping', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Mapping/Delete.ex.php b/api/v3/examples/Mapping/Delete.ex.php index 441b55c838..c70d4fd4d4 100644 --- a/api/v3/examples/Mapping/Delete.ex.php +++ b/api/v3/examples/Mapping/Delete.ex.php @@ -18,7 +18,7 @@ function mapping_delete_example() { try { $result = civicrm_api3('Mapping', 'delete', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Mapping/Get.ex.php b/api/v3/examples/Mapping/Get.ex.php index 2599098179..1c3c101dd8 100644 --- a/api/v3/examples/Mapping/Get.ex.php +++ b/api/v3/examples/Mapping/Get.ex.php @@ -20,7 +20,7 @@ function mapping_get_example() { try { $result = civicrm_api3('Mapping', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/MappingField/Create.ex.php b/api/v3/examples/MappingField/Create.ex.php index 0ba7a34fa7..27a3a7a8f2 100644 --- a/api/v3/examples/MappingField/Create.ex.php +++ b/api/v3/examples/MappingField/Create.ex.php @@ -22,7 +22,7 @@ function mapping_field_create_example() { try { $result = civicrm_api3('MappingField', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/MappingField/Delete.ex.php b/api/v3/examples/MappingField/Delete.ex.php index 3faab7c636..c9f6b23566 100644 --- a/api/v3/examples/MappingField/Delete.ex.php +++ b/api/v3/examples/MappingField/Delete.ex.php @@ -18,7 +18,7 @@ function mapping_field_delete_example() { try { $result = civicrm_api3('MappingField', 'delete', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/MappingField/Get.ex.php b/api/v3/examples/MappingField/Get.ex.php index ee39aa1edc..3e8403e6be 100644 --- a/api/v3/examples/MappingField/Get.ex.php +++ b/api/v3/examples/MappingField/Get.ex.php @@ -22,7 +22,7 @@ function mapping_field_get_example() { try { $result = civicrm_api3('MappingField', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Membership/Create.ex.php b/api/v3/examples/Membership/Create.ex.php index ad4357b6c9..fed7a91627 100644 --- a/api/v3/examples/Membership/Create.ex.php +++ b/api/v3/examples/Membership/Create.ex.php @@ -25,7 +25,7 @@ function membership_create_example() { try { $result = civicrm_api3('Membership', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Membership/CreateWithCustomData.ex.php b/api/v3/examples/Membership/CreateWithCustomData.ex.php index c37523e888..4f8ae718da 100644 --- a/api/v3/examples/Membership/CreateWithCustomData.ex.php +++ b/api/v3/examples/Membership/CreateWithCustomData.ex.php @@ -26,7 +26,7 @@ function membership_create_example() { try { $result = civicrm_api3('Membership', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Membership/Delete.ex.php b/api/v3/examples/Membership/Delete.ex.php index d11b0d0793..ee913f54d8 100644 --- a/api/v3/examples/Membership/Delete.ex.php +++ b/api/v3/examples/Membership/Delete.ex.php @@ -19,7 +19,7 @@ function membership_delete_example() { try { $result = civicrm_api3('Membership', 'delete', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Membership/FilterIsCurrent.ex.php b/api/v3/examples/Membership/FilterIsCurrent.ex.php index f0efeea000..f8434450f7 100644 --- a/api/v3/examples/Membership/FilterIsCurrent.ex.php +++ b/api/v3/examples/Membership/FilterIsCurrent.ex.php @@ -23,7 +23,7 @@ function membership_get_example() { try { $result = civicrm_api3('Membership', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Membership/Get.ex.php b/api/v3/examples/Membership/Get.ex.php index 98d76362c4..bba4a3150b 100644 --- a/api/v3/examples/Membership/Get.ex.php +++ b/api/v3/examples/Membership/Get.ex.php @@ -19,7 +19,7 @@ function membership_get_example() { try { $result = civicrm_api3('Membership', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Membership/SearchWithCustomData.ex.php b/api/v3/examples/Membership/SearchWithCustomData.ex.php index 900e2b4f38..4541fb4909 100644 --- a/api/v3/examples/Membership/SearchWithCustomData.ex.php +++ b/api/v3/examples/Membership/SearchWithCustomData.ex.php @@ -25,7 +25,7 @@ function membership_create_example() { try { $result = civicrm_api3('Membership', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Membership/UpdateCustomData.ex.php b/api/v3/examples/Membership/UpdateCustomData.ex.php index f21a17757d..6552c3487d 100644 --- a/api/v3/examples/Membership/UpdateCustomData.ex.php +++ b/api/v3/examples/Membership/UpdateCustomData.ex.php @@ -26,7 +26,7 @@ function membership_create_example() { try { $result = civicrm_api3('Membership', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/MembershipPayment/Create.ex.php b/api/v3/examples/MembershipPayment/Create.ex.php index 73d21e41b4..d48c64db57 100644 --- a/api/v3/examples/MembershipPayment/Create.ex.php +++ b/api/v3/examples/MembershipPayment/Create.ex.php @@ -19,7 +19,7 @@ function membership_payment_create_example() { try { $result = civicrm_api3('MembershipPayment', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/MembershipPayment/Get.ex.php b/api/v3/examples/MembershipPayment/Get.ex.php index 0f0043af14..fbe5c2aee4 100644 --- a/api/v3/examples/MembershipPayment/Get.ex.php +++ b/api/v3/examples/MembershipPayment/Get.ex.php @@ -19,7 +19,7 @@ function membership_payment_get_example() { try { $result = civicrm_api3('MembershipPayment', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/MembershipStatus/Create.ex.php b/api/v3/examples/MembershipStatus/Create.ex.php index fa9510a99a..0ba7d7347f 100644 --- a/api/v3/examples/MembershipStatus/Create.ex.php +++ b/api/v3/examples/MembershipStatus/Create.ex.php @@ -18,7 +18,7 @@ function membership_status_create_example() { try { $result = civicrm_api3('MembershipStatus', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/MembershipStatus/Get.ex.php b/api/v3/examples/MembershipStatus/Get.ex.php index 6039ecb367..095991660f 100644 --- a/api/v3/examples/MembershipStatus/Get.ex.php +++ b/api/v3/examples/MembershipStatus/Get.ex.php @@ -18,7 +18,7 @@ function membership_status_get_example() { try { $result = civicrm_api3('MembershipStatus', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/MembershipType/Create.ex.php b/api/v3/examples/MembershipType/Create.ex.php index 3939701e8f..93711c6412 100644 --- a/api/v3/examples/MembershipType/Create.ex.php +++ b/api/v3/examples/MembershipType/Create.ex.php @@ -27,7 +27,7 @@ function membership_type_create_example() { try { $result = civicrm_api3('MembershipType', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/MembershipType/Delete.ex.php b/api/v3/examples/MembershipType/Delete.ex.php index e64a2705b5..67aff9ba1b 100644 --- a/api/v3/examples/MembershipType/Delete.ex.php +++ b/api/v3/examples/MembershipType/Delete.ex.php @@ -18,7 +18,7 @@ function membership_type_delete_example() { try { $result = civicrm_api3('MembershipType', 'delete', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/MembershipType/Get.ex.php b/api/v3/examples/MembershipType/Get.ex.php index 2c403d858a..78bc437361 100644 --- a/api/v3/examples/MembershipType/Get.ex.php +++ b/api/v3/examples/MembershipType/Get.ex.php @@ -18,7 +18,7 @@ function membership_type_get_example() { try { $result = civicrm_api3('MembershipType', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/MessageTemplate/Create.ex.php b/api/v3/examples/MessageTemplate/Create.ex.php index 72102eda2e..386818f9cd 100644 --- a/api/v3/examples/MessageTemplate/Create.ex.php +++ b/api/v3/examples/MessageTemplate/Create.ex.php @@ -24,7 +24,7 @@ function message_template_create_example() { try { $result = civicrm_api3('MessageTemplate', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/MessageTemplate/Delete.ex.php b/api/v3/examples/MessageTemplate/Delete.ex.php index 99192c7874..4d3a118c99 100644 --- a/api/v3/examples/MessageTemplate/Delete.ex.php +++ b/api/v3/examples/MessageTemplate/Delete.ex.php @@ -18,7 +18,7 @@ function message_template_delete_example() { try { $result = civicrm_api3('MessageTemplate', 'delete', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/MessageTemplate/Get.ex.php b/api/v3/examples/MessageTemplate/Get.ex.php index 6763b823e2..3edf3985b4 100644 --- a/api/v3/examples/MessageTemplate/Get.ex.php +++ b/api/v3/examples/MessageTemplate/Get.ex.php @@ -24,7 +24,7 @@ function message_template_get_example() { try { $result = civicrm_api3('MessageTemplate', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Note/Create.ex.php b/api/v3/examples/Note/Create.ex.php index d56eb91842..71fb2729a8 100644 --- a/api/v3/examples/Note/Create.ex.php +++ b/api/v3/examples/Note/Create.ex.php @@ -25,7 +25,7 @@ function note_create_example() { try { $result = civicrm_api3('Note', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Note/Delete.ex.php b/api/v3/examples/Note/Delete.ex.php index 808d1eb5bc..370c49a036 100644 --- a/api/v3/examples/Note/Delete.ex.php +++ b/api/v3/examples/Note/Delete.ex.php @@ -18,7 +18,7 @@ function note_delete_example() { try { $result = civicrm_api3('Note', 'delete', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Note/Get.ex.php b/api/v3/examples/Note/Get.ex.php index 487285a992..c62583b45a 100644 --- a/api/v3/examples/Note/Get.ex.php +++ b/api/v3/examples/Note/Get.ex.php @@ -19,7 +19,7 @@ function note_get_example() { try { $result = civicrm_api3('Note', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/OpenID/Create.ex.php b/api/v3/examples/OpenID/Create.ex.php index 578297d5cd..41d665c8ba 100644 --- a/api/v3/examples/OpenID/Create.ex.php +++ b/api/v3/examples/OpenID/Create.ex.php @@ -20,7 +20,7 @@ function open_i_d_create_example() { try { $result = civicrm_api3('OpenID', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/OpenID/Delete.ex.php b/api/v3/examples/OpenID/Delete.ex.php index b5665d6820..1e906d9fbf 100644 --- a/api/v3/examples/OpenID/Delete.ex.php +++ b/api/v3/examples/OpenID/Delete.ex.php @@ -18,7 +18,7 @@ function open_i_d_delete_example() { try { $result = civicrm_api3('OpenID', 'delete', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/OpenID/Get.ex.php b/api/v3/examples/OpenID/Get.ex.php index e820524707..1f117d1dd0 100644 --- a/api/v3/examples/OpenID/Get.ex.php +++ b/api/v3/examples/OpenID/Get.ex.php @@ -21,7 +21,7 @@ function open_i_d_get_example() { try { $result = civicrm_api3('OpenID', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/OptionGroup/Create.ex.php b/api/v3/examples/OptionGroup/Create.ex.php index 54a7c59a94..1f23a4dc8e 100644 --- a/api/v3/examples/OptionGroup/Create.ex.php +++ b/api/v3/examples/OptionGroup/Create.ex.php @@ -28,7 +28,7 @@ function option_group_create_example() { try { $result = civicrm_api3('OptionGroup', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/OptionGroup/Delete.ex.php b/api/v3/examples/OptionGroup/Delete.ex.php index a80ceafe84..7b1e6acedd 100644 --- a/api/v3/examples/OptionGroup/Delete.ex.php +++ b/api/v3/examples/OptionGroup/Delete.ex.php @@ -18,7 +18,7 @@ function option_group_delete_example() { try { $result = civicrm_api3('OptionGroup', 'delete', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/OptionGroup/Get.ex.php b/api/v3/examples/OptionGroup/Get.ex.php index 3cce49a734..570c36ab2a 100644 --- a/api/v3/examples/OptionGroup/Get.ex.php +++ b/api/v3/examples/OptionGroup/Get.ex.php @@ -18,7 +18,7 @@ function option_group_get_example() { try { $result = civicrm_api3('OptionGroup', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/OptionValue/Get.ex.php b/api/v3/examples/OptionValue/Get.ex.php index 99ead82657..a69c81178e 100644 --- a/api/v3/examples/OptionValue/Get.ex.php +++ b/api/v3/examples/OptionValue/Get.ex.php @@ -18,7 +18,7 @@ function option_value_get_example() { try { $result = civicrm_api3('OptionValue', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/OptionValue/SortOption.ex.php b/api/v3/examples/OptionValue/SortOption.ex.php index 6dbad4c905..c68a2e3fd0 100644 --- a/api/v3/examples/OptionValue/SortOption.ex.php +++ b/api/v3/examples/OptionValue/SortOption.ex.php @@ -24,7 +24,7 @@ function option_value_getsingle_example() { try { $result = civicrm_api3('OptionValue', 'getsingle', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Order/Cancel.ex.php b/api/v3/examples/Order/Cancel.ex.php index fa2a1f7ffe..2ae843024d 100644 --- a/api/v3/examples/Order/Cancel.ex.php +++ b/api/v3/examples/Order/Cancel.ex.php @@ -18,7 +18,7 @@ function order_cancel_example() { try { $result = civicrm_api3('Order', 'cancel', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Order/Create.ex.php b/api/v3/examples/Order/Create.ex.php index 946df2862c..f1ecc96b39 100644 --- a/api/v3/examples/Order/Create.ex.php +++ b/api/v3/examples/Order/Create.ex.php @@ -48,7 +48,7 @@ function order_create_example() { try { $result = civicrm_api3('Order', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Order/CreateOrderParticipant.ex.php b/api/v3/examples/Order/CreateOrderParticipant.ex.php index 0eab7fdce9..310df9736c 100644 --- a/api/v3/examples/Order/CreateOrderParticipant.ex.php +++ b/api/v3/examples/Order/CreateOrderParticipant.ex.php @@ -58,7 +58,7 @@ function order_create_example() { try { $result = civicrm_api3('Order', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Order/Delete.ex.php b/api/v3/examples/Order/Delete.ex.php index 54828779ea..756db3d722 100644 --- a/api/v3/examples/Order/Delete.ex.php +++ b/api/v3/examples/Order/Delete.ex.php @@ -18,7 +18,7 @@ function order_delete_example() { try { $result = civicrm_api3('Order', 'delete', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Order/Get.ex.php b/api/v3/examples/Order/Get.ex.php index ba6353586f..abbca0d6b2 100644 --- a/api/v3/examples/Order/Get.ex.php +++ b/api/v3/examples/Order/Get.ex.php @@ -18,7 +18,7 @@ function order_get_example() { try { $result = civicrm_api3('Order', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Participant/Create.ex.php b/api/v3/examples/Participant/Create.ex.php index 27005da491..16a7251ba6 100644 --- a/api/v3/examples/Participant/Create.ex.php +++ b/api/v3/examples/Participant/Create.ex.php @@ -24,7 +24,7 @@ function participant_create_example() { try { $result = civicrm_api3('Participant', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Participant/Get.ex.php b/api/v3/examples/Participant/Get.ex.php index 0d8c637151..035406a6d0 100644 --- a/api/v3/examples/Participant/Get.ex.php +++ b/api/v3/examples/Participant/Get.ex.php @@ -18,7 +18,7 @@ function participant_get_example() { try { $result = civicrm_api3('Participant', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Participant/NestedDelete.ex.php b/api/v3/examples/Participant/NestedDelete.ex.php index cf785d31e0..bf49461548 100644 --- a/api/v3/examples/Participant/NestedDelete.ex.php +++ b/api/v3/examples/Participant/NestedDelete.ex.php @@ -21,7 +21,7 @@ function participant_get_example() { try { $result = civicrm_api3('Participant', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Participant/NestedEventGet.ex.php b/api/v3/examples/Participant/NestedEventGet.ex.php index 6862b98c28..921653f471 100644 --- a/api/v3/examples/Participant/NestedEventGet.ex.php +++ b/api/v3/examples/Participant/NestedEventGet.ex.php @@ -21,7 +21,7 @@ function participant_get_example() { try { $result = civicrm_api3('Participant', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/ParticipantPayment/Create.ex.php b/api/v3/examples/ParticipantPayment/Create.ex.php index e00d13fcde..e94e5914c3 100644 --- a/api/v3/examples/ParticipantPayment/Create.ex.php +++ b/api/v3/examples/ParticipantPayment/Create.ex.php @@ -19,7 +19,7 @@ function participant_payment_create_example() { try { $result = civicrm_api3('ParticipantPayment', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/ParticipantPayment/Delete.ex.php b/api/v3/examples/ParticipantPayment/Delete.ex.php index ba9ac3e665..0068ea6d24 100644 --- a/api/v3/examples/ParticipantPayment/Delete.ex.php +++ b/api/v3/examples/ParticipantPayment/Delete.ex.php @@ -18,7 +18,7 @@ function participant_payment_delete_example() { try { $result = civicrm_api3('ParticipantPayment', 'delete', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/ParticipantPayment/Get.ex.php b/api/v3/examples/ParticipantPayment/Get.ex.php index aeba37e143..52c297b5ab 100644 --- a/api/v3/examples/ParticipantPayment/Get.ex.php +++ b/api/v3/examples/ParticipantPayment/Get.ex.php @@ -19,7 +19,7 @@ function participant_payment_get_example() { try { $result = civicrm_api3('ParticipantPayment', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/ParticipantStatusType/Create.ex.php b/api/v3/examples/ParticipantStatusType/Create.ex.php index c00c9230c5..4a5f419947 100644 --- a/api/v3/examples/ParticipantStatusType/Create.ex.php +++ b/api/v3/examples/ParticipantStatusType/Create.ex.php @@ -25,7 +25,7 @@ function participant_status_type_create_example() { try { $result = civicrm_api3('ParticipantStatusType', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/ParticipantStatusType/Delete.ex.php b/api/v3/examples/ParticipantStatusType/Delete.ex.php index 52853e3c95..9cb675fbfd 100644 --- a/api/v3/examples/ParticipantStatusType/Delete.ex.php +++ b/api/v3/examples/ParticipantStatusType/Delete.ex.php @@ -18,7 +18,7 @@ function participant_status_type_delete_example() { try { $result = civicrm_api3('ParticipantStatusType', 'delete', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/ParticipantStatusType/Get.ex.php b/api/v3/examples/ParticipantStatusType/Get.ex.php index 89fcfb3c10..ccc0988064 100644 --- a/api/v3/examples/ParticipantStatusType/Get.ex.php +++ b/api/v3/examples/ParticipantStatusType/Get.ex.php @@ -25,7 +25,7 @@ function participant_status_type_get_example() { try { $result = civicrm_api3('ParticipantStatusType', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Payment/Cancel.ex.php b/api/v3/examples/Payment/Cancel.ex.php index 93fda68e28..323aaad977 100644 --- a/api/v3/examples/Payment/Cancel.ex.php +++ b/api/v3/examples/Payment/Cancel.ex.php @@ -19,7 +19,7 @@ function payment_cancel_example() { try { $result = civicrm_api3('Payment', 'cancel', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Payment/Create.ex.php b/api/v3/examples/Payment/Create.ex.php index 7f4304ca59..c1b14fd8e0 100644 --- a/api/v3/examples/Payment/Create.ex.php +++ b/api/v3/examples/Payment/Create.ex.php @@ -19,7 +19,7 @@ function payment_create_example() { try { $result = civicrm_api3('Payment', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Payment/CreatePaymentWithLineItems.ex.php b/api/v3/examples/Payment/CreatePaymentWithLineItems.ex.php index c907cf1747..c611d3ca7a 100644 --- a/api/v3/examples/Payment/CreatePaymentWithLineItems.ex.php +++ b/api/v3/examples/Payment/CreatePaymentWithLineItems.ex.php @@ -29,7 +29,7 @@ function payment_create_example() { try { $result = civicrm_api3('Payment', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Payment/Delete.ex.php b/api/v3/examples/Payment/Delete.ex.php index 7878115133..63a7fc79ce 100644 --- a/api/v3/examples/Payment/Delete.ex.php +++ b/api/v3/examples/Payment/Delete.ex.php @@ -19,7 +19,7 @@ function payment_delete_example() { try { $result = civicrm_api3('Payment', 'delete', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Payment/Get.ex.php b/api/v3/examples/Payment/Get.ex.php index b138cd7eb5..7028841c0c 100644 --- a/api/v3/examples/Payment/Get.ex.php +++ b/api/v3/examples/Payment/Get.ex.php @@ -19,7 +19,7 @@ function payment_get_example() { try { $result = civicrm_api3('Payment', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Payment/UpdatePayment.ex.php b/api/v3/examples/Payment/UpdatePayment.ex.php index 6802716ea9..bd40516ee7 100644 --- a/api/v3/examples/Payment/UpdatePayment.ex.php +++ b/api/v3/examples/Payment/UpdatePayment.ex.php @@ -23,7 +23,7 @@ function payment_create_example() { try { $result = civicrm_api3('Payment', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/PaymentProcessor/Create.ex.php b/api/v3/examples/PaymentProcessor/Create.ex.php index 69ee100f1d..c06083e0cf 100644 --- a/api/v3/examples/PaymentProcessor/Create.ex.php +++ b/api/v3/examples/PaymentProcessor/Create.ex.php @@ -22,7 +22,7 @@ function payment_processor_create_example() { try { $result = civicrm_api3('PaymentProcessor', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/PaymentProcessor/Delete.ex.php b/api/v3/examples/PaymentProcessor/Delete.ex.php index 5277566504..57fa4002a7 100644 --- a/api/v3/examples/PaymentProcessor/Delete.ex.php +++ b/api/v3/examples/PaymentProcessor/Delete.ex.php @@ -18,7 +18,7 @@ function payment_processor_delete_example() { try { $result = civicrm_api3('PaymentProcessor', 'delete', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/PaymentProcessorType/Create.ex.php b/api/v3/examples/PaymentProcessorType/Create.ex.php index 77b7384b19..b5a753c4d8 100644 --- a/api/v3/examples/PaymentProcessorType/Create.ex.php +++ b/api/v3/examples/PaymentProcessorType/Create.ex.php @@ -23,7 +23,7 @@ function payment_processor_type_create_example() { try { $result = civicrm_api3('PaymentProcessorType', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/PaymentProcessorType/Delete.ex.php b/api/v3/examples/PaymentProcessorType/Delete.ex.php index ce41157b04..c1af30e58e 100644 --- a/api/v3/examples/PaymentProcessorType/Delete.ex.php +++ b/api/v3/examples/PaymentProcessorType/Delete.ex.php @@ -18,7 +18,7 @@ function payment_processor_type_delete_example() { try { $result = civicrm_api3('PaymentProcessorType', 'delete', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/PaymentToken/Create.ex.php b/api/v3/examples/PaymentToken/Create.ex.php index 53dc8ae162..e16ea0be4e 100644 --- a/api/v3/examples/PaymentToken/Create.ex.php +++ b/api/v3/examples/PaymentToken/Create.ex.php @@ -24,7 +24,7 @@ function payment_token_create_example() { try { $result = civicrm_api3('PaymentToken', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/PaymentToken/Delete.ex.php b/api/v3/examples/PaymentToken/Delete.ex.php index 03d7fb263d..9fa39c5d12 100644 --- a/api/v3/examples/PaymentToken/Delete.ex.php +++ b/api/v3/examples/PaymentToken/Delete.ex.php @@ -18,7 +18,7 @@ function payment_token_delete_example() { try { $result = civicrm_api3('PaymentToken', 'delete', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/PaymentToken/Get.ex.php b/api/v3/examples/PaymentToken/Get.ex.php index fd3b33ba71..9995a23d74 100644 --- a/api/v3/examples/PaymentToken/Get.ex.php +++ b/api/v3/examples/PaymentToken/Get.ex.php @@ -21,7 +21,7 @@ function payment_token_get_example() { try { $result = civicrm_api3('PaymentToken', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Pcp/ChainedGetDelete.ex.php b/api/v3/examples/Pcp/ChainedGetDelete.ex.php index 5bab4a14a6..4901e25b00 100644 --- a/api/v3/examples/Pcp/ChainedGetDelete.ex.php +++ b/api/v3/examples/Pcp/ChainedGetDelete.ex.php @@ -21,7 +21,7 @@ function pcp_get_example() { try { $result = civicrm_api3('Pcp', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Pcp/Create.ex.php b/api/v3/examples/Pcp/Create.ex.php index 56aa78e395..c7325b8bdb 100644 --- a/api/v3/examples/Pcp/Create.ex.php +++ b/api/v3/examples/Pcp/Create.ex.php @@ -21,7 +21,7 @@ function pcp_create_example() { try { $result = civicrm_api3('Pcp', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Pcp/Delete.ex.php b/api/v3/examples/Pcp/Delete.ex.php index 83f1ec5677..380c889e8e 100644 --- a/api/v3/examples/Pcp/Delete.ex.php +++ b/api/v3/examples/Pcp/Delete.ex.php @@ -18,7 +18,7 @@ function pcp_delete_example() { try { $result = civicrm_api3('Pcp', 'delete', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Pcp/Get.ex.php b/api/v3/examples/Pcp/Get.ex.php index 36246cbbbb..5e87d5edd1 100644 --- a/api/v3/examples/Pcp/Get.ex.php +++ b/api/v3/examples/Pcp/Get.ex.php @@ -21,7 +21,7 @@ function pcp_get_example() { try { $result = civicrm_api3('Pcp', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Phone/Create.ex.php b/api/v3/examples/Phone/Create.ex.php index 95eab5a783..3f236a9a13 100644 --- a/api/v3/examples/Phone/Create.ex.php +++ b/api/v3/examples/Phone/Create.ex.php @@ -21,7 +21,7 @@ function phone_create_example() { try { $result = civicrm_api3('Phone', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Phone/Delete.ex.php b/api/v3/examples/Phone/Delete.ex.php index 44fa2491fa..19b8ef963d 100644 --- a/api/v3/examples/Phone/Delete.ex.php +++ b/api/v3/examples/Phone/Delete.ex.php @@ -18,7 +18,7 @@ function phone_delete_example() { try { $result = civicrm_api3('Phone', 'delete', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Phone/Get.ex.php b/api/v3/examples/Phone/Get.ex.php index 981506ad46..cce00a86f8 100644 --- a/api/v3/examples/Phone/Get.ex.php +++ b/api/v3/examples/Phone/Get.ex.php @@ -19,7 +19,7 @@ function phone_get_example() { try { $result = civicrm_api3('Phone', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Phone/GetOptions.ex.php b/api/v3/examples/Phone/GetOptions.ex.php index 4ca5d28124..8a2149d399 100644 --- a/api/v3/examples/Phone/GetOptions.ex.php +++ b/api/v3/examples/Phone/GetOptions.ex.php @@ -18,7 +18,7 @@ function phone_getoptions_example() { try { $result = civicrm_api3('Phone', 'getoptions', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Pledge/Create.ex.php b/api/v3/examples/Pledge/Create.ex.php index 53f81be28f..1e7949f88b 100644 --- a/api/v3/examples/Pledge/Create.ex.php +++ b/api/v3/examples/Pledge/Create.ex.php @@ -30,7 +30,7 @@ function pledge_create_example() { try { $result = civicrm_api3('Pledge', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Pledge/Delete.ex.php b/api/v3/examples/Pledge/Delete.ex.php index beb8fab405..3b68b3f55e 100644 --- a/api/v3/examples/Pledge/Delete.ex.php +++ b/api/v3/examples/Pledge/Delete.ex.php @@ -18,7 +18,7 @@ function pledge_delete_example() { try { $result = civicrm_api3('Pledge', 'delete', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Pledge/Get.ex.php b/api/v3/examples/Pledge/Get.ex.php index 99ba597bd6..7f9d7708e7 100644 --- a/api/v3/examples/Pledge/Get.ex.php +++ b/api/v3/examples/Pledge/Get.ex.php @@ -18,7 +18,7 @@ function pledge_get_example() { try { $result = civicrm_api3('Pledge', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Pledge/GetFilterHighDate.ex.php b/api/v3/examples/Pledge/GetFilterHighDate.ex.php index 612e701095..63bbc8c8e3 100644 --- a/api/v3/examples/Pledge/GetFilterHighDate.ex.php +++ b/api/v3/examples/Pledge/GetFilterHighDate.ex.php @@ -20,7 +20,7 @@ function pledge_get_example() { try { $result = civicrm_api3('Pledge', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/PledgePayment/Create.ex.php b/api/v3/examples/PledgePayment/Create.ex.php index 354e2d545a..77fe0c235e 100644 --- a/api/v3/examples/PledgePayment/Create.ex.php +++ b/api/v3/examples/PledgePayment/Create.ex.php @@ -22,7 +22,7 @@ function pledge_payment_create_example() { try { $result = civicrm_api3('PledgePayment', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/PledgePayment/Delete.ex.php b/api/v3/examples/PledgePayment/Delete.ex.php index b3ffa0f071..a457f28994 100644 --- a/api/v3/examples/PledgePayment/Delete.ex.php +++ b/api/v3/examples/PledgePayment/Delete.ex.php @@ -18,7 +18,7 @@ function pledge_payment_delete_example() { try { $result = civicrm_api3('PledgePayment', 'delete', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/PledgePayment/Get.ex.php b/api/v3/examples/PledgePayment/Get.ex.php index 6c79278e9d..e125994b6e 100644 --- a/api/v3/examples/PledgePayment/Get.ex.php +++ b/api/v3/examples/PledgePayment/Get.ex.php @@ -16,7 +16,7 @@ function pledge_payment_get_example() { try { $result = civicrm_api3('PledgePayment', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/PledgePayment/Update.ex.php b/api/v3/examples/PledgePayment/Update.ex.php index 3d9f0bc215..1a529a30b5 100644 --- a/api/v3/examples/PledgePayment/Update.ex.php +++ b/api/v3/examples/PledgePayment/Update.ex.php @@ -19,7 +19,7 @@ function pledge_payment_update_example() { try { $result = civicrm_api3('PledgePayment', 'update', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/PriceField/Create.ex.php b/api/v3/examples/PriceField/Create.ex.php index 87dadf1993..55b46038c2 100644 --- a/api/v3/examples/PriceField/Create.ex.php +++ b/api/v3/examples/PriceField/Create.ex.php @@ -23,7 +23,7 @@ function price_field_create_example() { try { $result = civicrm_api3('PriceField', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/PriceField/Delete.ex.php b/api/v3/examples/PriceField/Delete.ex.php index b8b136acaf..050116d70a 100644 --- a/api/v3/examples/PriceField/Delete.ex.php +++ b/api/v3/examples/PriceField/Delete.ex.php @@ -18,7 +18,7 @@ function price_field_delete_example() { try { $result = civicrm_api3('PriceField', 'delete', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/PriceField/Get.ex.php b/api/v3/examples/PriceField/Get.ex.php index 7d02feb7dd..1be17d8f0d 100644 --- a/api/v3/examples/PriceField/Get.ex.php +++ b/api/v3/examples/PriceField/Get.ex.php @@ -18,7 +18,7 @@ function price_field_get_example() { try { $result = civicrm_api3('PriceField', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/PriceFieldValue/Create.ex.php b/api/v3/examples/PriceFieldValue/Create.ex.php index ea5f8c026c..2231e10ab9 100644 --- a/api/v3/examples/PriceFieldValue/Create.ex.php +++ b/api/v3/examples/PriceFieldValue/Create.ex.php @@ -25,7 +25,7 @@ function price_field_value_create_example() { try { $result = civicrm_api3('PriceFieldValue', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/PriceFieldValue/Delete.ex.php b/api/v3/examples/PriceFieldValue/Delete.ex.php index 92aa1150cc..cc5ae1d553 100644 --- a/api/v3/examples/PriceFieldValue/Delete.ex.php +++ b/api/v3/examples/PriceFieldValue/Delete.ex.php @@ -18,7 +18,7 @@ function price_field_value_delete_example() { try { $result = civicrm_api3('PriceFieldValue', 'delete', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/PriceFieldValue/Get.ex.php b/api/v3/examples/PriceFieldValue/Get.ex.php index 4011501cf7..174c60b102 100644 --- a/api/v3/examples/PriceFieldValue/Get.ex.php +++ b/api/v3/examples/PriceFieldValue/Get.ex.php @@ -18,7 +18,7 @@ function price_field_value_get_example() { try { $result = civicrm_api3('PriceFieldValue', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/PriceSet/Create.ex.php b/api/v3/examples/PriceSet/Create.ex.php index ade9452b33..a87d608fd6 100644 --- a/api/v3/examples/PriceSet/Create.ex.php +++ b/api/v3/examples/PriceSet/Create.ex.php @@ -22,7 +22,7 @@ function price_set_create_example() { try { $result = civicrm_api3('PriceSet', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/PriceSet/Delete.ex.php b/api/v3/examples/PriceSet/Delete.ex.php index 2fdb2dfe25..6e96a460ae 100644 --- a/api/v3/examples/PriceSet/Delete.ex.php +++ b/api/v3/examples/PriceSet/Delete.ex.php @@ -18,7 +18,7 @@ function price_set_delete_example() { try { $result = civicrm_api3('PriceSet', 'delete', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/PriceSet/Get.ex.php b/api/v3/examples/PriceSet/Get.ex.php index 9b9eac2ff3..69f8546942 100644 --- a/api/v3/examples/PriceSet/Get.ex.php +++ b/api/v3/examples/PriceSet/Get.ex.php @@ -18,7 +18,7 @@ function price_set_get_example() { try { $result = civicrm_api3('PriceSet', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Profile/Apply.ex.php b/api/v3/examples/Profile/Apply.ex.php index 0ec9137f6d..abd71e114c 100644 --- a/api/v3/examples/Profile/Apply.ex.php +++ b/api/v3/examples/Profile/Apply.ex.php @@ -25,7 +25,7 @@ function profile_apply_example() { try { $result = civicrm_api3('Profile', 'apply', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Profile/Get.ex.php b/api/v3/examples/Profile/Get.ex.php index b264dc7e96..c67491aa48 100644 --- a/api/v3/examples/Profile/Get.ex.php +++ b/api/v3/examples/Profile/Get.ex.php @@ -23,7 +23,7 @@ function profile_get_example() { try { $result = civicrm_api3('Profile', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Profile/GetFields.ex.php b/api/v3/examples/Profile/GetFields.ex.php index ee57a5e603..79902a2704 100644 --- a/api/v3/examples/Profile/GetFields.ex.php +++ b/api/v3/examples/Profile/GetFields.ex.php @@ -21,7 +21,7 @@ function profile_getfields_example() { try { $result = civicrm_api3('Profile', 'getfields', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Profile/Submit.ex.php b/api/v3/examples/Profile/Submit.ex.php index 841fcb32a2..451dc557f9 100644 --- a/api/v3/examples/Profile/Submit.ex.php +++ b/api/v3/examples/Profile/Submit.ex.php @@ -25,7 +25,7 @@ function profile_submit_example() { try { $result = civicrm_api3('Profile', 'submit', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Relationship/BetweenRelationshipType.ex.php b/api/v3/examples/Relationship/BetweenRelationshipType.ex.php index 0b50ad12b3..63c181afb4 100644 --- a/api/v3/examples/Relationship/BetweenRelationshipType.ex.php +++ b/api/v3/examples/Relationship/BetweenRelationshipType.ex.php @@ -25,7 +25,7 @@ function relationship_get_example() { try { $result = civicrm_api3('Relationship', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Relationship/Create.ex.php b/api/v3/examples/Relationship/Create.ex.php index e405bc51b1..75124b5db7 100644 --- a/api/v3/examples/Relationship/Create.ex.php +++ b/api/v3/examples/Relationship/Create.ex.php @@ -24,7 +24,7 @@ function relationship_create_example() { try { $result = civicrm_api3('Relationship', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Relationship/Delete.ex.php b/api/v3/examples/Relationship/Delete.ex.php index 0f561e92d5..2aff8d4278 100644 --- a/api/v3/examples/Relationship/Delete.ex.php +++ b/api/v3/examples/Relationship/Delete.ex.php @@ -18,7 +18,7 @@ function relationship_delete_example() { try { $result = civicrm_api3('Relationship', 'delete', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Relationship/Get.ex.php b/api/v3/examples/Relationship/Get.ex.php index c3ea39ed3a..f48b9c04e4 100644 --- a/api/v3/examples/Relationship/Get.ex.php +++ b/api/v3/examples/Relationship/Get.ex.php @@ -18,7 +18,7 @@ function relationship_get_example() { try { $result = civicrm_api3('Relationship', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Relationship/INRelationshipType.ex.php b/api/v3/examples/Relationship/INRelationshipType.ex.php index 74544ef72c..eab2a8acbc 100644 --- a/api/v3/examples/Relationship/INRelationshipType.ex.php +++ b/api/v3/examples/Relationship/INRelationshipType.ex.php @@ -25,7 +25,7 @@ function relationship_get_example() { try { $result = civicrm_api3('Relationship', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Relationship/NotBetweenRelationshipType.ex.php b/api/v3/examples/Relationship/NotBetweenRelationshipType.ex.php index eafff85eff..c4e79bd809 100644 --- a/api/v3/examples/Relationship/NotBetweenRelationshipType.ex.php +++ b/api/v3/examples/Relationship/NotBetweenRelationshipType.ex.php @@ -25,7 +25,7 @@ function relationship_get_example() { try { $result = civicrm_api3('Relationship', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Relationship/NotInRelationshipType.ex.php b/api/v3/examples/Relationship/NotInRelationshipType.ex.php index 2696dada28..818472ecba 100644 --- a/api/v3/examples/Relationship/NotInRelationshipType.ex.php +++ b/api/v3/examples/Relationship/NotInRelationshipType.ex.php @@ -25,7 +25,7 @@ function relationship_get_example() { try { $result = civicrm_api3('Relationship', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Relationship/filterIsCurrent.ex.php b/api/v3/examples/Relationship/filterIsCurrent.ex.php index 5407675555..452e7005a4 100644 --- a/api/v3/examples/Relationship/filterIsCurrent.ex.php +++ b/api/v3/examples/Relationship/filterIsCurrent.ex.php @@ -22,7 +22,7 @@ function relationship_get_example() { try { $result = civicrm_api3('Relationship', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/RelationshipType/Create.ex.php b/api/v3/examples/RelationshipType/Create.ex.php index 9c7d4d3537..cfc602faf1 100644 --- a/api/v3/examples/RelationshipType/Create.ex.php +++ b/api/v3/examples/RelationshipType/Create.ex.php @@ -24,7 +24,7 @@ function relationship_type_create_example() { try { $result = civicrm_api3('RelationshipType', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/RelationshipType/Delete.ex.php b/api/v3/examples/RelationshipType/Delete.ex.php index 23c3ea9245..f4cddd5020 100644 --- a/api/v3/examples/RelationshipType/Delete.ex.php +++ b/api/v3/examples/RelationshipType/Delete.ex.php @@ -18,7 +18,7 @@ function relationship_type_delete_example() { try { $result = civicrm_api3('RelationshipType', 'delete', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/ReportTemplate/Getrows.ex.php b/api/v3/examples/ReportTemplate/Getrows.ex.php index 5441ac2df7..d948f5019b 100644 --- a/api/v3/examples/ReportTemplate/Getrows.ex.php +++ b/api/v3/examples/ReportTemplate/Getrows.ex.php @@ -26,7 +26,7 @@ function report_template_getrows_example() { try { $result = civicrm_api3('ReportTemplate', 'getrows', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/ReportTemplate/Getstatistics.ex.php b/api/v3/examples/ReportTemplate/Getstatistics.ex.php index 762ecb4309..59d83f26b5 100644 --- a/api/v3/examples/ReportTemplate/Getstatistics.ex.php +++ b/api/v3/examples/ReportTemplate/Getstatistics.ex.php @@ -20,7 +20,7 @@ function report_template_getstatistics_example() { try { $result = civicrm_api3('ReportTemplate', 'getstatistics', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/SavedSearch/Create.ex.php b/api/v3/examples/SavedSearch/Create.ex.php index 8a376d32d5..517cdb1b19 100644 --- a/api/v3/examples/SavedSearch/Create.ex.php +++ b/api/v3/examples/SavedSearch/Create.ex.php @@ -32,7 +32,7 @@ function saved_search_create_example() { try { $result = civicrm_api3('SavedSearch', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/SavedSearch/Delete.ex.php b/api/v3/examples/SavedSearch/Delete.ex.php index 37574e701e..7a09625346 100644 --- a/api/v3/examples/SavedSearch/Delete.ex.php +++ b/api/v3/examples/SavedSearch/Delete.ex.php @@ -18,7 +18,7 @@ function saved_search_delete_example() { try { $result = civicrm_api3('SavedSearch', 'delete', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/SavedSearch/Get.ex.php b/api/v3/examples/SavedSearch/Get.ex.php index 7d948d0a67..9fef1a9e82 100644 --- a/api/v3/examples/SavedSearch/Get.ex.php +++ b/api/v3/examples/SavedSearch/Get.ex.php @@ -18,7 +18,7 @@ function saved_search_get_example() { try { $result = civicrm_api3('SavedSearch', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Setting/Create.ex.php b/api/v3/examples/Setting/Create.ex.php index 7ea582474c..8fffe7d5c3 100644 --- a/api/v3/examples/Setting/Create.ex.php +++ b/api/v3/examples/Setting/Create.ex.php @@ -19,7 +19,7 @@ function setting_create_example() { try { $result = civicrm_api3('Setting', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Setting/CreateAllDomains.ex.php b/api/v3/examples/Setting/CreateAllDomains.ex.php index f5117e6fe2..281f8e62b9 100644 --- a/api/v3/examples/Setting/CreateAllDomains.ex.php +++ b/api/v3/examples/Setting/CreateAllDomains.ex.php @@ -21,7 +21,7 @@ function setting_create_example() { try { $result = civicrm_api3('Setting', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Setting/CreateSettingCurrentDomain.ex.php b/api/v3/examples/Setting/CreateSettingCurrentDomain.ex.php index 13d5f90554..057ad5b4af 100644 --- a/api/v3/examples/Setting/CreateSettingCurrentDomain.ex.php +++ b/api/v3/examples/Setting/CreateSettingCurrentDomain.ex.php @@ -20,7 +20,7 @@ function setting_create_example() { try { $result = civicrm_api3('Setting', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Setting/CreateSpecifiedDomains.ex.php b/api/v3/examples/Setting/CreateSpecifiedDomains.ex.php index 9e27e290eb..115f8b0b7c 100644 --- a/api/v3/examples/Setting/CreateSpecifiedDomains.ex.php +++ b/api/v3/examples/Setting/CreateSpecifiedDomains.ex.php @@ -24,7 +24,7 @@ function setting_create_example() { try { $result = civicrm_api3('Setting', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Setting/Get.ex.php b/api/v3/examples/Setting/Get.ex.php index 03a62f4028..6366789307 100644 --- a/api/v3/examples/Setting/Get.ex.php +++ b/api/v3/examples/Setting/Get.ex.php @@ -19,7 +19,7 @@ function setting_get_example() { try { $result = civicrm_api3('Setting', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Setting/GetAllDomains.ex.php b/api/v3/examples/Setting/GetAllDomains.ex.php index d2d96418b1..f4f545cfc1 100644 --- a/api/v3/examples/Setting/GetAllDomains.ex.php +++ b/api/v3/examples/Setting/GetAllDomains.ex.php @@ -21,7 +21,7 @@ function setting_get_example() { try { $result = civicrm_api3('Setting', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Setting/GetDefaults.ex.php b/api/v3/examples/Setting/GetDefaults.ex.php index a721feaf0a..eaa1158e1f 100644 --- a/api/v3/examples/Setting/GetDefaults.ex.php +++ b/api/v3/examples/Setting/GetDefaults.ex.php @@ -20,7 +20,7 @@ function setting_getdefaults_example() { try { $result = civicrm_api3('Setting', 'getdefaults', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Setting/GetFields.ex.php b/api/v3/examples/Setting/GetFields.ex.php index 2765ad7ac7..ee1e78de0e 100644 --- a/api/v3/examples/Setting/GetFields.ex.php +++ b/api/v3/examples/Setting/GetFields.ex.php @@ -18,7 +18,7 @@ function setting_getfields_example() { try { $result = civicrm_api3('Setting', 'getfields', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Setting/GetSettingCurrentDomain.ex.php b/api/v3/examples/Setting/GetSettingCurrentDomain.ex.php index 2939c09a99..b24dd50b40 100644 --- a/api/v3/examples/Setting/GetSettingCurrentDomain.ex.php +++ b/api/v3/examples/Setting/GetSettingCurrentDomain.ex.php @@ -20,7 +20,7 @@ function setting_get_example() { try { $result = civicrm_api3('Setting', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Setting/GetSpecifiedDomains.ex.php b/api/v3/examples/Setting/GetSpecifiedDomains.ex.php index 5bcd7b2990..e5b6f83f62 100644 --- a/api/v3/examples/Setting/GetSpecifiedDomains.ex.php +++ b/api/v3/examples/Setting/GetSpecifiedDomains.ex.php @@ -26,7 +26,7 @@ function setting_get_example() { try { $result = civicrm_api3('Setting', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Setting/GetValue.ex.php b/api/v3/examples/Setting/GetValue.ex.php index 7a5cb0f22f..9125ca5256 100644 --- a/api/v3/examples/Setting/GetValue.ex.php +++ b/api/v3/examples/Setting/GetValue.ex.php @@ -21,7 +21,7 @@ function setting_getvalue_example() { try { $result = civicrm_api3('Setting', 'getvalue', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Setting/Revert.ex.php b/api/v3/examples/Setting/Revert.ex.php index 070211dfe9..5d414f9631 100644 --- a/api/v3/examples/Setting/Revert.ex.php +++ b/api/v3/examples/Setting/Revert.ex.php @@ -20,7 +20,7 @@ function setting_revert_example() { try { $result = civicrm_api3('Setting', 'revert', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/StateProvince/Create.ex.php b/api/v3/examples/StateProvince/Create.ex.php index 8cf583aa33..2d07ecf6b2 100644 --- a/api/v3/examples/StateProvince/Create.ex.php +++ b/api/v3/examples/StateProvince/Create.ex.php @@ -20,7 +20,7 @@ function state_province_create_example() { try { $result = civicrm_api3('StateProvince', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/StateProvince/Delete.ex.php b/api/v3/examples/StateProvince/Delete.ex.php index 14e280b8f5..c51a5a0e69 100644 --- a/api/v3/examples/StateProvince/Delete.ex.php +++ b/api/v3/examples/StateProvince/Delete.ex.php @@ -18,7 +18,7 @@ function state_province_delete_example() { try { $result = civicrm_api3('StateProvince', 'delete', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/StateProvince/Get.ex.php b/api/v3/examples/StateProvince/Get.ex.php index 057206f1a8..18d2a9ce4a 100644 --- a/api/v3/examples/StateProvince/Get.ex.php +++ b/api/v3/examples/StateProvince/Get.ex.php @@ -18,7 +18,7 @@ function state_province_get_example() { try { $result = civicrm_api3('StateProvince', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/StatusPreference/Create.ex.php b/api/v3/examples/StatusPreference/Create.ex.php index 509536b270..6eb9b4525d 100644 --- a/api/v3/examples/StatusPreference/Create.ex.php +++ b/api/v3/examples/StatusPreference/Create.ex.php @@ -22,7 +22,7 @@ function status_preference_create_example() { try { $result = civicrm_api3('StatusPreference', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/StatusPreference/Delete.ex.php b/api/v3/examples/StatusPreference/Delete.ex.php index 418e7514f9..a4582c6eec 100644 --- a/api/v3/examples/StatusPreference/Delete.ex.php +++ b/api/v3/examples/StatusPreference/Delete.ex.php @@ -18,7 +18,7 @@ function status_preference_delete_example() { try { $result = civicrm_api3('StatusPreference', 'delete', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/StatusPreference/Get.ex.php b/api/v3/examples/StatusPreference/Get.ex.php index 0feb43099e..f94a270575 100644 --- a/api/v3/examples/StatusPreference/Get.ex.php +++ b/api/v3/examples/StatusPreference/Get.ex.php @@ -18,7 +18,7 @@ function status_preference_get_example() { try { $result = civicrm_api3('StatusPreference', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Survey/ChainedGetDelete.ex.php b/api/v3/examples/Survey/ChainedGetDelete.ex.php index df1218be8b..4a24b150d9 100644 --- a/api/v3/examples/Survey/ChainedGetDelete.ex.php +++ b/api/v3/examples/Survey/ChainedGetDelete.ex.php @@ -21,7 +21,7 @@ function survey_get_example() { try { $result = civicrm_api3('Survey', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Survey/Create.ex.php b/api/v3/examples/Survey/Create.ex.php index 3dce012bd7..ef2eba60f4 100644 --- a/api/v3/examples/Survey/Create.ex.php +++ b/api/v3/examples/Survey/Create.ex.php @@ -21,7 +21,7 @@ function survey_create_example() { try { $result = civicrm_api3('Survey', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Survey/Delete.ex.php b/api/v3/examples/Survey/Delete.ex.php index 1cfe8ea9e4..b93ad2be83 100644 --- a/api/v3/examples/Survey/Delete.ex.php +++ b/api/v3/examples/Survey/Delete.ex.php @@ -18,7 +18,7 @@ function survey_delete_example() { try { $result = civicrm_api3('Survey', 'delete', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Survey/Get.ex.php b/api/v3/examples/Survey/Get.ex.php index 7dac9efd14..06a257139e 100644 --- a/api/v3/examples/Survey/Get.ex.php +++ b/api/v3/examples/Survey/Get.ex.php @@ -21,7 +21,7 @@ function survey_get_example() { try { $result = civicrm_api3('Survey', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/SurveyRespondant/Get.ex.php b/api/v3/examples/SurveyRespondant/Get.ex.php index 2e93c13aad..87ad6fa333 100644 --- a/api/v3/examples/SurveyRespondant/Get.ex.php +++ b/api/v3/examples/SurveyRespondant/Get.ex.php @@ -22,7 +22,7 @@ function survey_respondant_get_example() { try { $result = civicrm_api3('SurveyRespondant', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/System/Flush.ex.php b/api/v3/examples/System/Flush.ex.php index a5323b45fb..5e9f8acbdd 100644 --- a/api/v3/examples/System/Flush.ex.php +++ b/api/v3/examples/System/Flush.ex.php @@ -18,7 +18,7 @@ function system_flush_example() { try { $result = civicrm_api3('System', 'flush', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Tag/Create.ex.php b/api/v3/examples/Tag/Create.ex.php index e3bbbb9f10..92da15c578 100644 --- a/api/v3/examples/Tag/Create.ex.php +++ b/api/v3/examples/Tag/Create.ex.php @@ -19,7 +19,7 @@ function tag_create_example() { try { $result = civicrm_api3('Tag', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Tag/Delete.ex.php b/api/v3/examples/Tag/Delete.ex.php index 2371cb6039..a00738ac35 100644 --- a/api/v3/examples/Tag/Delete.ex.php +++ b/api/v3/examples/Tag/Delete.ex.php @@ -18,7 +18,7 @@ function tag_delete_example() { try { $result = civicrm_api3('Tag', 'delete', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Tag/Get.ex.php b/api/v3/examples/Tag/Get.ex.php index ace87a8763..f2d1b724b6 100644 --- a/api/v3/examples/Tag/Get.ex.php +++ b/api/v3/examples/Tag/Get.ex.php @@ -19,7 +19,7 @@ function tag_get_example() { try { $result = civicrm_api3('Tag', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Tag/GetFields.ex.php b/api/v3/examples/Tag/GetFields.ex.php index 789b79c899..c754b5a433 100644 --- a/api/v3/examples/Tag/GetFields.ex.php +++ b/api/v3/examples/Tag/GetFields.ex.php @@ -20,7 +20,7 @@ function tag_getfields_example() { try { $result = civicrm_api3('Tag', 'getfields', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Tag/GetList.ex.php b/api/v3/examples/Tag/GetList.ex.php index 23aa5c33b1..d5f540c033 100644 --- a/api/v3/examples/Tag/GetList.ex.php +++ b/api/v3/examples/Tag/GetList.ex.php @@ -23,7 +23,7 @@ function tag_getlist_example() { try { $result = civicrm_api3('Tag', 'getlist', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Tag/GetReturnArray.ex.php b/api/v3/examples/Tag/GetReturnArray.ex.php index 9ccbb63fa1..d5518b1e7e 100644 --- a/api/v3/examples/Tag/GetReturnArray.ex.php +++ b/api/v3/examples/Tag/GetReturnArray.ex.php @@ -24,7 +24,7 @@ function tag_get_example() { try { $result = civicrm_api3('Tag', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/TaxContributionPage/Create.ex.php b/api/v3/examples/TaxContributionPage/Create.ex.php index 5dd5d4fcd2..5c48e3b6be 100644 --- a/api/v3/examples/TaxContributionPage/Create.ex.php +++ b/api/v3/examples/TaxContributionPage/Create.ex.php @@ -26,7 +26,7 @@ function tax_contribution_page_create_example() { try { $result = civicrm_api3('tax_contribution_page', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/TaxContributionPage/CreateWithNestedLineItems.ex.php b/api/v3/examples/TaxContributionPage/CreateWithNestedLineItems.ex.php index fe1b5a8af7..d71a6e2751 100644 --- a/api/v3/examples/TaxContributionPage/CreateWithNestedLineItems.ex.php +++ b/api/v3/examples/TaxContributionPage/CreateWithNestedLineItems.ex.php @@ -48,7 +48,7 @@ function tax_contribution_page_create_example() { try { $result = civicrm_api3('tax_contribution_page', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/TaxContributionPage/Delete.ex.php b/api/v3/examples/TaxContributionPage/Delete.ex.php index fe9fc736ee..aab88461c9 100644 --- a/api/v3/examples/TaxContributionPage/Delete.ex.php +++ b/api/v3/examples/TaxContributionPage/Delete.ex.php @@ -18,7 +18,7 @@ function tax_contribution_page_delete_example() { try { $result = civicrm_api3('tax_contribution_page', 'delete', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/UFField/Create.ex.php b/api/v3/examples/UFField/Create.ex.php index 947797d36f..79587ab169 100644 --- a/api/v3/examples/UFField/Create.ex.php +++ b/api/v3/examples/UFField/Create.ex.php @@ -27,7 +27,7 @@ function uf_field_create_example() { try { $result = civicrm_api3('UFField', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/UFField/Delete.ex.php b/api/v3/examples/UFField/Delete.ex.php index 95ef1f9063..8b441b82de 100644 --- a/api/v3/examples/UFField/Delete.ex.php +++ b/api/v3/examples/UFField/Delete.ex.php @@ -18,7 +18,7 @@ function uf_field_delete_example() { try { $result = civicrm_api3('UFField', 'delete', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/UFField/Get.ex.php b/api/v3/examples/UFField/Get.ex.php index 2d8cf63484..7ed1b1546f 100644 --- a/api/v3/examples/UFField/Get.ex.php +++ b/api/v3/examples/UFField/Get.ex.php @@ -16,7 +16,7 @@ function uf_field_get_example() { try { $result = civicrm_api3('UFField', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/UFField/Replace.ex.php b/api/v3/examples/UFField/Replace.ex.php index 4bad961e70..a3da0d3a30 100644 --- a/api/v3/examples/UFField/Replace.ex.php +++ b/api/v3/examples/UFField/Replace.ex.php @@ -52,7 +52,7 @@ function uf_field_replace_example() { try { $result = civicrm_api3('UFField', 'replace', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/UFGroup/Create.ex.php b/api/v3/examples/UFGroup/Create.ex.php index 879d513ec2..d4ea27b181 100644 --- a/api/v3/examples/UFGroup/Create.ex.php +++ b/api/v3/examples/UFGroup/Create.ex.php @@ -37,7 +37,7 @@ function uf_group_create_example() { try { $result = civicrm_api3('UFGroup', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/UFGroup/Delete.ex.php b/api/v3/examples/UFGroup/Delete.ex.php index b25743455a..a1745bfb89 100644 --- a/api/v3/examples/UFGroup/Delete.ex.php +++ b/api/v3/examples/UFGroup/Delete.ex.php @@ -18,7 +18,7 @@ function uf_group_delete_example() { try { $result = civicrm_api3('UFGroup', 'delete', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/UFGroup/Get.ex.php b/api/v3/examples/UFGroup/Get.ex.php index fc4d018ae3..25127e0bc9 100644 --- a/api/v3/examples/UFGroup/Get.ex.php +++ b/api/v3/examples/UFGroup/Get.ex.php @@ -18,7 +18,7 @@ function uf_group_get_example() { try { $result = civicrm_api3('UFGroup', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/UFJoin/Create.ex.php b/api/v3/examples/UFJoin/Create.ex.php index b0244edbe9..52fcc0975b 100644 --- a/api/v3/examples/UFJoin/Create.ex.php +++ b/api/v3/examples/UFJoin/Create.ex.php @@ -24,7 +24,7 @@ function uf_join_create_example() { try { $result = civicrm_api3('UFJoin', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/UFJoin/Get.ex.php b/api/v3/examples/UFJoin/Get.ex.php index 08f3ca6443..50ea381ebb 100644 --- a/api/v3/examples/UFJoin/Get.ex.php +++ b/api/v3/examples/UFJoin/Get.ex.php @@ -20,7 +20,7 @@ function uf_join_get_example() { try { $result = civicrm_api3('UFJoin', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/UFMatch/Get.ex.php b/api/v3/examples/UFMatch/Get.ex.php index 8b87d90e44..d4d6e24c19 100644 --- a/api/v3/examples/UFMatch/Get.ex.php +++ b/api/v3/examples/UFMatch/Get.ex.php @@ -18,7 +18,7 @@ function uf_match_get_example() { try { $result = civicrm_api3('UFMatch', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/User/Get.ex.php b/api/v3/examples/User/Get.ex.php index 92cc07edd2..e5879ca59f 100644 --- a/api/v3/examples/User/Get.ex.php +++ b/api/v3/examples/User/Get.ex.php @@ -19,7 +19,7 @@ function user_get_example() { try { $result = civicrm_api3('User', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/User/GetFields.ex.php b/api/v3/examples/User/GetFields.ex.php index 4df70c6922..905194a08f 100644 --- a/api/v3/examples/User/GetFields.ex.php +++ b/api/v3/examples/User/GetFields.ex.php @@ -18,7 +18,7 @@ function user_getfields_example() { try { $result = civicrm_api3('User', 'getfields', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Website/Create.ex.php b/api/v3/examples/Website/Create.ex.php index ba17211e96..2ec70d1cd3 100644 --- a/api/v3/examples/Website/Create.ex.php +++ b/api/v3/examples/Website/Create.ex.php @@ -20,7 +20,7 @@ function website_create_example() { try { $result = civicrm_api3('Website', 'create', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Website/Delete.ex.php b/api/v3/examples/Website/Delete.ex.php index 2b04101b8a..c08be41dff 100644 --- a/api/v3/examples/Website/Delete.ex.php +++ b/api/v3/examples/Website/Delete.ex.php @@ -18,7 +18,7 @@ function website_delete_example() { try { $result = civicrm_api3('Website', 'delete', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Website/Get.ex.php b/api/v3/examples/Website/Get.ex.php index 8492e1faef..63b3a32b18 100644 --- a/api/v3/examples/Website/Get.ex.php +++ b/api/v3/examples/Website/Get.ex.php @@ -20,7 +20,7 @@ function website_get_example() { try { $result = civicrm_api3('Website', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Website/GetFields.ex.php b/api/v3/examples/Website/GetFields.ex.php index 6801f5543a..cb69653997 100644 --- a/api/v3/examples/Website/GetFields.ex.php +++ b/api/v3/examples/Website/GetFields.ex.php @@ -18,7 +18,7 @@ function website_getfields_example() { try { $result = civicrm_api3('Website', 'getfields', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/examples/Website/GetWithMetadata.ex.php b/api/v3/examples/Website/GetWithMetadata.ex.php index d3cd32d16d..652a3c562b 100644 --- a/api/v3/examples/Website/GetWithMetadata.ex.php +++ b/api/v3/examples/Website/GetWithMetadata.ex.php @@ -24,7 +24,7 @@ function website_get_example() { try { $result = civicrm_api3('Website', 'get', $params); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); diff --git a/api/v3/utils.php b/api/v3/utils.php index 4e650695db..504d7d0fec 100644 --- a/api/v3/utils.php +++ b/api/v3/utils.php @@ -34,7 +34,7 @@ function _civicrm_api3_initialize() { * @param array $keyoptions * List of required fields options. One of the options is required. * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ function civicrm_api3_verify_one_mandatory($params, $daoName = NULL, $keyoptions = []) { $keys = [[]]; @@ -55,7 +55,7 @@ function civicrm_api3_verify_one_mandatory($params, $daoName = NULL, $keyoptions * List of required fields. A value can be an array denoting that either this or that is required. * @param bool $verifyDAO * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ function civicrm_api3_verify_mandatory($params, $daoName = NULL, $keys = [], $verifyDAO = TRUE) { $unmatched = []; @@ -95,7 +95,7 @@ function civicrm_api3_verify_mandatory($params, $daoName = NULL, $keys = [], $ve } } if (!empty($unmatched)) { - throw new API_Exception('Mandatory key(s) missing from params array: ' . implode(", ", $unmatched), 'mandatory_missing', ["fields" => $unmatched]); + throw new CRM_Core_Exception('Mandatory key(s) missing from params array: ' . implode(", ", $unmatched), 'mandatory_missing', ["fields" => $unmatched]); } } @@ -142,7 +142,7 @@ function civicrm_api3_create_error($msg, $data = []) { * - this param is currently used for legacy behaviour support * * @return array - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ function civicrm_api3_create_success($values = 1, $params = [], $entity = NULL, $action = NULL, &$dao = NULL, $extraReturnValues = []) { $result = []; @@ -512,7 +512,7 @@ function _civicrm_api3_field_names($fields) { * (used if return not set - but don't do that - set return!). * * @return array - * @throws API_Exception + * @throws CRM_Core_Exception */ function _civicrm_api3_get_using_query_object($entity, $params, $additional_options = [], $getCount = NULL, $mode = 1, $defaultReturnProperties = NULL) { $lowercase_entity = _civicrm_api_get_entity_name_from_camel($entity); @@ -646,7 +646,7 @@ function _civicrm_api3_get_query_object($params, $mode, $entity) { * API specific queries eg for event isCurrent would be converted to * $extraSql['where'] = array('civicrm_event' => array('(start_date >= CURDATE() || end_date >= CURDATE())')); * - * @throws API_Exception + * @throws CRM_Core_Exception * @throws Exception */ function _civicrm_api3_dao_set_filter(&$dao, $params, $unique = TRUE, $extraSql = []) { @@ -696,7 +696,7 @@ function _civicrm_api3_dao_set_filter(&$dao, $params, $unique = TRUE, $extraSql if ($unique) { $daoFieldName = $allfields[$field]['name']; if (empty($daoFieldName)) { - throw new API_Exception("Failed to determine field name for \"$field\""); + throw new CRM_Core_Exception("Failed to determine field name for \"$field\""); } $dao->{$daoFieldName} = $params[$field]; } @@ -783,7 +783,7 @@ function _civicrm_api3_apply_filters_to_dao($filterField, $filterValue, &$dao) { * @param string $entity * @param string $action * - * @throws API_Exception + * @throws CRM_Core_Exception * @return array * options extracted from params */ @@ -851,14 +851,14 @@ function _civicrm_api3_get_options_from_params($params, $queryObject = FALSE, $e $finalSort[] = $s; } else { - throw new API_Exception("Unknown field specified for sort. Cannot order by '$s'"); + throw new CRM_Core_Exception("Unknown field specified for sort. Cannot order by '$s'"); } } $options['sort'] = implode(', ', $finalSort); } if ($options['sort'] && stristr($options['sort'], 'SELECT')) { - throw new API_Exception('invalid string in sort options'); + throw new CRM_Core_Exception('invalid string in sort options'); } if (!$queryObject) { @@ -882,7 +882,7 @@ function _civicrm_api3_get_options_from_params($params, $queryObject = FALSE, $e elseif (!in_array($n, $otherVars)) { $inputParams[$n] = $v; if ($v && !is_array($v) && stristr($v, 'SELECT')) { - throw new API_Exception('invalid string'); + throw new CRM_Core_Exception('invalid string'); } } } @@ -900,7 +900,6 @@ function _civicrm_api3_get_options_from_params($params, $queryObject = FALSE, $e * DAO object. * @param string $entity * - * @throws \API_Exception * @throws \CRM_Core_Exception */ function _civicrm_api3_apply_options_to_dao(&$params, &$dao, $entity) { @@ -977,7 +976,7 @@ function _civicrm_api3_get_unique_name_array(&$bao) { * * @return array * - * @throws \API_Exception + * @throws \CRM_Core_Exception * * @deprecated - DAO based retrieval is being phased out. * @@ -1030,7 +1029,7 @@ function _civicrm_api3_dao_to_array($dao, $params = NULL, $uniqueFields = TRUE, * @param array $params * * @return bool - * @throws \API_Exception + * @throws \CRM_Core_Exception * * @todo filter so only required fields are queried */ @@ -1299,7 +1298,7 @@ function _civicrm_api3_basic_get($bao_name, $params, $returnAsSuccess = TRUE, $e * @param string $entity * Entity - pass in if entity is non-standard & required $ids array. * - * @throws API_Exception + * @throws CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException * @return array */ @@ -1329,7 +1328,7 @@ function _civicrm_api3_basic_create($bao_name, &$params, $entity = NULL) { // so we need to reset the error object here to avoid getting concatenated errors //@todo - the mulitple error handling should be moved out of the contribution object to the import / multiple entity processes CRM_Core_Error::singleton()->reset(); - throw new API_Exception($msg); + throw new CRM_Core_Exception($msg); } else { // If we have custom fields the BAO may have taken care of it or we may have to. @@ -1369,7 +1368,7 @@ function _civicrm_api3_basic_create($bao_name, &$params, $entity = NULL) { * @param string|CRM_Core_DAO $bao_name * @param array $params * - * @throws API_Exception + * @throws CRM_Core_Exception * * @return CRM_Core_DAO|NULL * An instance of the BAO @@ -1389,9 +1388,9 @@ function _civicrm_api3_basic_create_fallback($bao_name, $params) { * @return array * API result array * - * @throws API_Exception + * @throws CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ function _civicrm_api3_basic_delete($bao_name, &$params) { civicrm_api3_verify_mandatory($params, NULL, ['id']); @@ -1405,9 +1404,9 @@ function _civicrm_api3_basic_delete($bao_name, &$params) { if ($bao !== FALSE) { return civicrm_api3_create_success(); } - throw new API_Exception('Could not delete entity id ' . $params['id']); + throw new CRM_Core_Exception('Could not delete entity id ' . $params['id']); } - throw new API_Exception('Could not delete entity id ' . $params['id']); + throw new CRM_Core_Exception('Could not delete entity id ' . $params['id']); } else { $bao_name::deleteRecord($params); @@ -1492,7 +1491,7 @@ function _civicrm_api3_custom_data_get(&$returnArray, $checkPermission, $entity, * @param array $params * * @return array $errors - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ function _civicrm_api3_validate($entity, $action, $params) { $errors = []; @@ -1544,7 +1543,7 @@ function _civicrm_api3_validate($entity, $action, $params) { * @param array $params * @param string $action * - * @throws API_Exception + * @throws CRM_Core_Exception * @throws Exception */ function _civicrm_api3_validate_switch_cases($fieldName, $fieldInfo, $entity, $params, $action) { @@ -1767,7 +1766,7 @@ function _civicrm_api3_getValidDate($dateValue, $fieldName, $fieldType) { * Array of fields from getfields function. * @param string $entity * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ function _civicrm_api3_validate_constraint($fieldValue, $fieldName, $fieldInfo, $entity) { $daoName = $fieldInfo['FKClassName']; @@ -1780,7 +1779,7 @@ function _civicrm_api3_validate_constraint($fieldValue, $fieldName, $fieldInfo, $dao->selectAdd(); $dao->selectAdd('id'); if (!$dao->find()) { - throw new API_Exception("$fieldName is not valid : " . $fieldValue); + throw new CRM_Core_Exception("$fieldName is not valid : " . $fieldValue); } } @@ -1806,7 +1805,7 @@ function _civicrm_api3_validate_unique_key(&$params, &$fieldName) { // an entry already exists for this unique field if ($existing['count'] == 1) { // question - could this ever be a security issue? - throw new API_Exception("Field: `$fieldName` must be unique. An conflicting entity already exists - id: " . $existing['id']); + throw new CRM_Core_Exception("Field: `$fieldName` must be unique. An conflicting entity already exists - id: " . $existing['id']); } } @@ -2082,7 +2081,7 @@ function _civicrm_api3_swap_out_aliases(&$apiRequest, $fields) { * Array of fields from getfields function. * @param string $entity * - * @throws API_Exception + * @throws CRM_Core_Exception */ function _civicrm_api3_validate_integer(&$params, $fieldName, &$fieldInfo, $entity) { [$fieldValue, $op] = _civicrm_api3_field_value_check($params, $fieldName); @@ -2099,7 +2098,7 @@ function _civicrm_api3_validate_integer(&$params, $fieldName, &$fieldInfo, $enti if (!is_numeric($fieldValue) && is_scalar($fieldValue)) { $realContactId = _civicrm_api3_resolve_contactID($fieldValue); if ('unknown-user' === $realContactId) { - throw new API_Exception("\"$fieldName\" \"{$fieldValue}\" cannot be resolved to a contact ID", 2002, ['error_field' => $fieldName, "type" => "integer"]); + throw new CRM_Core_Exception("\"$fieldName\" \"{$fieldValue}\" cannot be resolved to a contact ID", 2002, ['error_field' => $fieldName, "type" => "integer"]); } elseif (is_numeric($realContactId)) { $fieldValue = $realContactId; @@ -2128,14 +2127,14 @@ function _civicrm_api3_validate_integer(&$params, $fieldName, &$fieldInfo, $enti // After swapping options, ensure we have an integer(s) foreach ((array) ($fieldValue) as $value) { if ($value && !is_numeric($value) && $value !== 'null' && $value !== NULL && !is_array($value)) { - throw new API_Exception("$fieldName is not a valid integer", 2001, ['error_field' => $fieldName, "type" => "integer"]); + throw new CRM_Core_Exception("$fieldName is not a valid integer", 2001, ['error_field' => $fieldName, "type" => "integer"]); } } // Check our field length if (is_string($fieldValue) && !empty($fieldInfo['maxlength']) && strlen($fieldValue) > $fieldInfo['maxlength'] ) { - throw new API_Exception($fieldValue . " is " . strlen($fieldValue) . " characters - longer than $fieldName length" . $fieldInfo['maxlength'] . ' characters', + throw new CRM_Core_Exception($fieldValue . " is " . strlen($fieldValue) . " characters - longer than $fieldName length" . $fieldInfo['maxlength'] . ' characters', 2100, ['field' => $fieldName, "max_length" => $fieldInfo['maxlength']] ); } @@ -2232,7 +2231,7 @@ function _civicrm_api3_resolve_contactID($contactIdExpr) { * @param string $fieldName * @param array $fieldInfo * - * @throws API_Exception + * @throws CRM_Core_Exception */ function _civicrm_api3_validate_html(&$params, &$fieldName, $fieldInfo) { [$fieldValue, $op] = _civicrm_api3_field_value_check($params, $fieldName); @@ -2253,7 +2252,7 @@ function _civicrm_api3_validate_html(&$params, &$fieldName, $fieldInfo) { * @param string $entity * @param string $action * - * @throws API_Exception + * @throws CRM_Core_Exception * @throws Exception */ function _civicrm_api3_validate_string(&$params, &$fieldName, &$fieldInfo, $entity, $action) { @@ -2281,7 +2280,7 @@ function _civicrm_api3_validate_string(&$params, &$fieldName, &$fieldInfo, $enti try { _civicrm_api3_api_match_pseudoconstant($fieldValue, $entity, $fieldName, $fieldInfo, $op); } - catch (API_Exception $e) { + catch (CRM_Core_Exception $e) { // For get operations, allow any string if (!$isGet) { throw $e; @@ -2290,7 +2289,7 @@ function _civicrm_api3_validate_string(&$params, &$fieldName, &$fieldInfo, $enti } // Check our field length elseif (is_string($fieldValue) && !empty($fieldInfo['maxlength']) && strlen(utf8_decode($fieldValue)) > $fieldInfo['maxlength']) { - throw new API_Exception("Value for $fieldName is " . strlen(utf8_decode($value)) . " characters - This field has a maxlength of {$fieldInfo['maxlength']} characters.", + throw new CRM_Core_Exception("Value for $fieldName is " . strlen(utf8_decode($value)) . " characters - This field has a maxlength of {$fieldInfo['maxlength']} characters.", 2100, ['field' => $fieldName] ); } @@ -2313,7 +2312,7 @@ function _civicrm_api3_validate_string(&$params, &$fieldName, &$fieldInfo, $enti * @param string $op * @param array $additional_lookup_params * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ function _civicrm_api3_api_match_pseudoconstant(&$fieldValue, $entity, $fieldName, $fieldInfo, $op = '=', $additional_lookup_params = []) { if (in_array($op, ['>', '<', '>=', '<=', 'LIKE', 'NOT LIKE'])) { @@ -2367,7 +2366,7 @@ function _civicrm_api3_api_match_pseudoconstant(&$fieldValue, $entity, $fieldNam * in case we have the weird situation of it being a valid option in which case our * brains will probably explode. * - * @throws API_Exception + * @throws CRM_Core_Exception */ function _civicrm_api3_api_match_pseudoconstant_value(&$value, $options, $fieldName, $isRequired) { // If option is a key, no need to translate @@ -2419,7 +2418,7 @@ function _civicrm_api3_api_match_pseudoconstant_value(&$value, $options, $fieldN } } if ($newValue === FALSE) { - throw new API_Exception("'$value' is not a valid option for field $fieldName", 2001, ['error_field' => $fieldName]); + throw new CRM_Core_Exception("'$value' is not a valid option for field $fieldName", 2001, ['error_field' => $fieldName]); } $value = $newValue; } @@ -2533,7 +2532,7 @@ function _civicrm_api3_field_value_check(&$params, $fieldName, $type = NULL) { * List of filterable fields. * * @return array - * @throws \API_Exception + * @throws \CRM_Core_Exception */ function _civicrm_api3_basic_array_get($entity, $params, $records, $idCol, $filterableFields) { $options = _civicrm_api3_get_options_from_params($params, TRUE, $entity, 'get'); @@ -2605,7 +2604,7 @@ function _civicrm_api3_basic_array_get($entity, $params, $records, $idCol, $filt return in_array($recordVal, $searchVal) == ($operator == 'IN'); default: - throw new API_Exception("Unsupported operator: '$operator' cannot be used with array data"); + throw new CRM_Core_Exception("Unsupported operator: '$operator' cannot be used with array data"); } }; @@ -2677,7 +2676,7 @@ function _civicrm_api3_check_edit_permissions($bao_name, $params) { * @param string $entity API Entity * * @return bool - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ function _civicrm_api3_compare_timestamps($modifiedDate, $id, $entity) { $currentDbInfo = civicrm_api3($entity, 'getsingle', ['id' => $id]); -- 2.25.1