|
17 | 17 | */ |
18 | 18 | class ConfigTransformationEventSubscriber implements EventSubscriberInterface, ContainerInjectionInterface { |
19 | 19 |
|
20 | | - const PRIORITY = 250; |
| 20 | + protected const PRIORITY = 250; |
| 21 | + |
| 22 | + protected const PREFIXES_TO_IGNORE = [ |
| 23 | + 'migrate_plus.migration.isi__', |
| 24 | + 'migrate_plus.migration_group.isi__', |
| 25 | + 'islandora_spreadsheet_ingest.request.', |
| 26 | + ]; |
21 | 27 |
|
22 | 28 | /** |
23 | 29 | * Constructor. |
@@ -55,8 +61,8 @@ public static function getSubscribedEvents() : array { |
55 | 61 | */ |
56 | 62 | public function onExportTransform(StorageTransformEvent $event) : void { |
57 | 63 | $storage = $event->getStorage(); |
58 | | - foreach ($this->toIgnore($storage) as $name) { |
59 | | - $storage->delete($name); |
| 64 | + foreach (static::PREFIXES_TO_IGNORE as $prefix) { |
| 65 | + $storage->deleteAll($prefix); |
60 | 66 | } |
61 | 67 | } |
62 | 68 |
|
@@ -93,9 +99,9 @@ public function onImportTransform(StorageTransformEvent $event) : void { |
93 | 99 | * The names of the configs that should never be changed on imports/exports. |
94 | 100 | */ |
95 | 101 | protected static function toIgnore(StorageInterface $storage) : \Generator { |
96 | | - yield from $storage->listAll('migrate_plus.migration.isi__'); |
97 | | - yield from $storage->listAll('migrate_plus.migration_group.isi__'); |
98 | | - yield from $storage->listAll('islandora_spreadsheet_ingest.request.'); |
| 102 | + foreach (static::PREFIXES_TO_IGNORE as $prefix) { |
| 103 | + yield from $storage->listAll($prefix); |
| 104 | + } |
99 | 105 | } |
100 | 106 |
|
101 | 107 | } |
0 commit comments