MCPcopy Create free account
hub / github.com/mikro-orm/mikro-orm / constructor

Method constructor

packages/core/src/EntityManager.ts:137–152  ·  view source on GitHub ↗

* @internal

(
    readonly config: Configuration,
    protected readonly driver: Driver,
    protected readonly metadata: MetadataStorage,
    useContext = true,
    protected readonly eventManager: EventManager = new EventManager(config.get('subscribers')),
  )

Source from the content-addressed store, hash-verified

135 * @internal
136 */
137 constructor(
138 readonly config: Configuration,
139 protected readonly driver: Driver,
140 protected readonly metadata: MetadataStorage,
141 useContext = true,
142 protected readonly eventManager: EventManager = new EventManager(config.get('subscribers')),
143 ) {
144 this.#useContext = useContext;
145 this.#entityLoader = new EntityLoader(this);
146 this.name = this.config.get('contextName');
147 this.#comparator = this.config.getComparator(this.metadata);
148 this.#resultCache = this.config.getResultCacheAdapter();
149 this.#disableTransactions = this.config.get('disableTransactions');
150 this.#entityFactory = new EntityFactory(this);
151 this.#unitOfWork = new UnitOfWork(this);
152 }
153
154 /**
155 * Gets the Driver instance used by this EntityManager.

Callers

nothing calls this directly

Calls 3

getResultCacheAdapterMethod · 0.80
getMethod · 0.65
getComparatorMethod · 0.45

Tested by

no test coverage detected