From f956daee3b229ca5a3f5d4662394c03bd27c1558 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Wed, 17 Aug 2022 11:34:52 +1200 Subject: [PATCH] Add 'Entity' to the information import classes provide --- CRM/Activity/Import/Parser/Activity.php | 1 + CRM/Contact/Import/Parser/Contact.php | 1 + CRM/Contribute/Import/Parser/Contribution.php | 1 + CRM/Core/BAO/UserJob.php | 11 +++++++---- CRM/Custom/Import/Parser/Api.php | 1 + CRM/Event/Import/Parser/Participant.php | 1 + CRM/Member/Import/Parser/Membership.php | 1 + 7 files changed, 13 insertions(+), 4 deletions(-) diff --git a/CRM/Activity/Import/Parser/Activity.php b/CRM/Activity/Import/Parser/Activity.php index d45940f885..4b37a0fe04 100644 --- a/CRM/Activity/Import/Parser/Activity.php +++ b/CRM/Activity/Import/Parser/Activity.php @@ -37,6 +37,7 @@ class CRM_Activity_Import_Parser_Activity extends CRM_Import_Parser { 'id' => 'activity_import', 'name' => 'activity_import', 'label' => ts('Activity Import'), + 'entity' => 'Activity', ], ]; } diff --git a/CRM/Contact/Import/Parser/Contact.php b/CRM/Contact/Import/Parser/Contact.php index f132581060..cf7c765d59 100644 --- a/CRM/Contact/Import/Parser/Contact.php +++ b/CRM/Contact/Import/Parser/Contact.php @@ -100,6 +100,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Import_Parser { 'id' => 'contact_import', 'name' => 'contact_import', 'label' => ts('Contact Import'), + 'entity' => 'Contact', ], ]; } diff --git a/CRM/Contribute/Import/Parser/Contribution.php b/CRM/Contribute/Import/Parser/Contribution.php index 25bc640189..2111ded8f5 100644 --- a/CRM/Contribute/Import/Parser/Contribution.php +++ b/CRM/Contribute/Import/Parser/Contribution.php @@ -58,6 +58,7 @@ class CRM_Contribute_Import_Parser_Contribution extends CRM_Import_Parser { 'id' => 'contribution_import', 'name' => 'contribution_import', 'label' => ts('Contribution Import'), + 'entity' => 'Contribution', ], ]; } diff --git a/CRM/Core/BAO/UserJob.php b/CRM/Core/BAO/UserJob.php index fe5ca8785e..0f1c683500 100644 --- a/CRM/Core/BAO/UserJob.php +++ b/CRM/Core/BAO/UserJob.php @@ -135,10 +135,12 @@ class CRM_Core_BAO_UserJob extends CRM_Core_DAO_UserJob implements \Civi\Core\Ho /** * Get the types Import Jobs. * - * This is largely a placeholder at this stage. It will likely wind - * up as an option value so extensions can add different types. - * - * However, for now it just holds the one type being worked on. + * Each type is keyed by it's id and has + * -id + * -name + * -label + * -class + * -entity * * @return array */ @@ -148,6 +150,7 @@ class CRM_Core_BAO_UserJob extends CRM_Core_DAO_UserJob implements \Civi\Core\Ho $types = []; $classes = ClassScanner::get(['interface' => UserJobInterface::class]); foreach ($classes as $class) { + /* @var UserJobInterface $class */ $declaredTypes = $class::getUserJobInfo(); foreach ($declaredTypes as $index => $declaredType) { $declaredTypes[$index]['class'] = $class; diff --git a/CRM/Custom/Import/Parser/Api.php b/CRM/Custom/Import/Parser/Api.php index 6fc4f41a06..e5d86ee35a 100644 --- a/CRM/Custom/Import/Parser/Api.php +++ b/CRM/Custom/Import/Parser/Api.php @@ -25,6 +25,7 @@ class CRM_Custom_Import_Parser_Api extends CRM_Import_Parser { 'id' => 'custom_field_import', 'name' => 'custom_field_import', 'label' => ts('Multiple Value Custom Field Import'), + 'entity' => 'Contact', ], ]; } diff --git a/CRM/Event/Import/Parser/Participant.php b/CRM/Event/Import/Parser/Participant.php index de8b919289..4502d6afa3 100644 --- a/CRM/Event/Import/Parser/Participant.php +++ b/CRM/Event/Import/Parser/Participant.php @@ -84,6 +84,7 @@ class CRM_Event_Import_Parser_Participant extends CRM_Import_Parser { 'id' => 'participant_import', 'name' => 'participant_import', 'label' => ts('Participant Import'), + 'entity' => 'Participant', ], ]; } diff --git a/CRM/Member/Import/Parser/Membership.php b/CRM/Member/Import/Parser/Membership.php index 5c6dbc9b22..552a9c4af3 100644 --- a/CRM/Member/Import/Parser/Membership.php +++ b/CRM/Member/Import/Parser/Membership.php @@ -70,6 +70,7 @@ class CRM_Member_Import_Parser_Membership extends CRM_Import_Parser { 'id' => 'membership_import', 'name' => 'membership_import', 'label' => ts('Membership Import'), + 'entity' => 'Membership', ], ]; } -- 2.25.1