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

Method bind

packages/core/src/entity/Reference.ts:316–320  ·  view source on GitHub ↗

Binds this scalar reference to a specific entity and property for lazy loading support.

(entity: Entity, property: EntityKey<Entity>)

Source from the content-addressed store, hash-verified

314
315 /** Binds this scalar reference to a specific entity and property for lazy loading support. */
316 bind<Entity extends object>(entity: Entity, property: EntityKey<Entity>): void {
317 this.entity = entity;
318 this.#property = property;
319 Object.defineProperty(this, 'entity', { enumerable: false, value: entity });
320 }
321
322 /** Returns the current scalar value, or undefined if not yet loaded. */
323 unwrap(): Value | undefined {

Callers 13

updateMethod · 0.80
getPropertySnapshotMethod · 0.80
_cloneFunction · 0.80
loadEnvironmentVarsFunction · 0.80
Configuration.tsFile · 0.80
dispatchEventMethod · 0.80
handlerMethod · 0.80
createDriverMethod · 0.80
createKyselyDialectMethod · 0.80
setup.tsFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected