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

Method getProperty

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

Returns the value of a property on the underlying entity. Throws if the reference is not initialized.

(prop: K)

Source from the content-addressed store, hash-verified

209
210 /** Returns the value of a property on the underlying entity. Throws if the reference is not initialized. */
211 getProperty<K extends keyof T>(prop: K): T[K] {
212 return this.getEntity()[prop];
213 }
214
215 /** Loads the entity if needed, then returns the value of the specified property. */
216 async loadProperty<TT extends T, P extends string = never, K extends keyof TT = keyof TT>(

Callers 4

readTypeFromSourceMethod · 0.45
wrapPaginateSubQueryMethod · 0.45

Calls 1

getEntityMethod · 0.95

Tested by

no test coverage detected