forked from noxious/server
yes
This commit is contained in:
parent
b2e0ac47e7
commit
0e0854d365
@ -5,9 +5,13 @@ import Logger, { LoggerType } from '#application/logger'
|
|||||||
|
|
||||||
export abstract class BaseEntity {
|
export abstract class BaseEntity {
|
||||||
protected readonly logger = Logger.type(LoggerType.ENTITY)
|
protected readonly logger = Logger.type(LoggerType.ENTITY)
|
||||||
|
protected entityManager?: EntityManager
|
||||||
|
|
||||||
private getEntityManager(): EntityManager {
|
private getEntityManager(): EntityManager {
|
||||||
return Database.getORM().em.fork()
|
if (!this.entityManager) {
|
||||||
|
this.entityManager = Database.getORM().em.fork()
|
||||||
|
}
|
||||||
|
return this.entityManager
|
||||||
}
|
}
|
||||||
|
|
||||||
async save(): Promise<this> {
|
async save(): Promise<this> {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user