More map editor work
This commit is contained in:
@ -14,6 +14,11 @@ export abstract class BaseEntity {
|
||||
return this.entityManager
|
||||
}
|
||||
|
||||
public setEntityManager(entityManager: EntityManager) {
|
||||
this.entityManager = entityManager
|
||||
return this
|
||||
}
|
||||
|
||||
async save(): Promise<this> {
|
||||
return this.execute('persist', 'save entity')
|
||||
}
|
||||
@ -22,7 +27,11 @@ export abstract class BaseEntity {
|
||||
return this.execute('remove', 'remove entity')
|
||||
}
|
||||
|
||||
private async execute(method: 'persist' | 'remove', actionDescription: string): Promise<this> {
|
||||
async update(): Promise<this> {
|
||||
return this.execute('merge', 'update entity')
|
||||
}
|
||||
|
||||
private async execute(method: 'persist' | 'merge' | 'remove', actionDescription: string): Promise<this> {
|
||||
try {
|
||||
const em = this.getEntityManager()
|
||||
|
||||
|
Reference in New Issue
Block a user