Add 'Entity' to the information import classes provide
authorEileen McNaughton <emcnaughton@wikimedia.org>
Tue, 16 Aug 2022 23:34:52 +0000 (11:34 +1200)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Tue, 16 Aug 2022 23:36:19 +0000 (11:36 +1200)
CRM/Activity/Import/Parser/Activity.php
CRM/Contact/Import/Parser/Contact.php
CRM/Contribute/Import/Parser/Contribution.php
CRM/Core/BAO/UserJob.php
CRM/Custom/Import/Parser/Api.php
CRM/Event/Import/Parser/Participant.php
CRM/Member/Import/Parser/Membership.php

index d45940f885e6ad34778ae278267595e4b2c0c173..4b37a0fe045bbc789e67b0fe297e62fb8a31baec 100644 (file)
@@ -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',
       ],
     ];
   }
index f132581060aa753efac18df7d43d4895936c8f0a..cf7c765d590d610f57dabab313dc4ff8cd60eed9 100644 (file)
@@ -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',
       ],
     ];
   }
index 25bc640189e7cde7fda31ed1fd8b6136cf56c48e..2111ded8f51a5eab374939ff9df602856fd210d1 100644 (file)
@@ -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',
       ],
     ];
   }
index fe5ca8785ef2d6c3c6ea1a0877868b3ba86f021c..0f1c6835002b0557d9710e4674b951b1a937c563 100644 (file)
@@ -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;
index 6fc4f41a06cafc9b231ca5ffcf6b78fe3a13b3bb..e5d86ee35ac7a13c6d58d3ea5fa5f34938843b5a 100644 (file)
@@ -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',
       ],
     ];
   }
index de8b919289e80ed229a3343018025cc5f7d4a947..4502d6afa37412f64171fc83e03e569d26855c3d 100644 (file)
@@ -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',
       ],
     ];
   }
index 5c6dbc9b22ee484cbdb809afc9ac7c0374929cf6..552a9c4af3b0a804574ec9f10ea2cecbb6dbe815 100644 (file)
@@ -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',
       ],
     ];
   }