Skip to content

Commit

Permalink
Merge pull request #24285 from eileenmcnaughton/import_dec
Browse files Browse the repository at this point in the history
Add 'Entity' to the information import parser classes provide
  • Loading branch information
eileenmcnaughton authored Aug 17, 2022
2 parents 4035fca + f956dae commit d437098
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 4 deletions.
1 change: 1 addition & 0 deletions CRM/Activity/Import/Parser/Activity.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public static function getUserJobInfo(): array {
'id' => 'activity_import',
'name' => 'activity_import',
'label' => ts('Activity Import'),
'entity' => 'Activity',
],
];
}
Expand Down
1 change: 1 addition & 0 deletions CRM/Contact/Import/Parser/Contact.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ public static function getUserJobInfo(): array {
'id' => 'contact_import',
'name' => 'contact_import',
'label' => ts('Contact Import'),
'entity' => 'Contact',
],
];
}
Expand Down
1 change: 1 addition & 0 deletions CRM/Contribute/Import/Parser/Contribution.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public static function getUserJobInfo(): array {
'id' => 'contribution_import',
'name' => 'contribution_import',
'label' => ts('Contribution Import'),
'entity' => 'Contribution',
],
];
}
Expand Down
11 changes: 7 additions & 4 deletions CRM/Core/BAO/UserJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,12 @@ public static function getStatuses(): array {
/**
* 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
*/
Expand All @@ -148,6 +150,7 @@ public static function getTypes(): array {
$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;
Expand Down
1 change: 1 addition & 0 deletions CRM/Custom/Import/Parser/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public static function getUserJobInfo(): array {
'id' => 'custom_field_import',
'name' => 'custom_field_import',
'label' => ts('Multiple Value Custom Field Import'),
'entity' => 'Contact',
],
];
}
Expand Down
1 change: 1 addition & 0 deletions CRM/Event/Import/Parser/Participant.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ public static function getUserJobInfo(): array {
'id' => 'participant_import',
'name' => 'participant_import',
'label' => ts('Participant Import'),
'entity' => 'Participant',
],
];
}
Expand Down
1 change: 1 addition & 0 deletions CRM/Member/Import/Parser/Membership.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ public static function getUserJobInfo(): array {
'id' => 'membership_import',
'name' => 'membership_import',
'label' => ts('Membership Import'),
'entity' => 'Membership',
],
];
}
Expand Down

0 comments on commit d437098

Please sign in to comment.