(oldId, newId)
| 74 | } |
| 75 | |
| 76 | changeId(oldId, newId) { |
| 77 | const mapping = this.getMapping(oldId); |
| 78 | if (mapping && oldId !== newId) { |
| 79 | mapping.id = newId; |
| 80 | mapping.altLabel = null; |
| 81 | this.mappingItems.set(newId, mapping); |
| 82 | |
| 83 | // replace any references to this mapping in other mappings' properties |
| 84 | this.applyToEntityRefs(oldId, (mappingId, propName) => |
| 85 | this.addProperty(mappingId, propName, { entity: newId }) |
| 86 | ); |
| 87 | this.removeMapping(oldId); |
| 88 | } |
| 89 | |
| 90 | return this; |
| 91 | } |
| 92 | |
| 93 | getValues() { |
| 94 | return Array.from(this.mappingItems.values()); |
no test coverage detected