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

Function init

packages/core/src/entity/BaseEntity.ts:161–168  ·  view source on GitHub ↗

Initializes (refreshes) the entity by reloading it from the database. Returns null if not found.

(options?: FindOneOptions<Entity, Hint, Fields, Excludes>)

Source from the content-addressed store, hash-verified

159
160 /** Initializes (refreshes) the entity by reloading it from the database. Returns null if not found. */
161 init<
162 Entity extends this = this,
163 Hint extends string = never,
164 Fields extends string = never,
165 Excludes extends string = never,
166 >(options?: FindOneOptions<Entity, Hint, Fields, Excludes>): Promise<Loaded<Entity, Hint, Fields, Excludes> | null> {
167 return helper(this as Entity).init(options);
168 }
169
170 /** Returns the database schema this entity belongs to. */
171 getSchema(): string | undefined {

Callers

nothing calls this directly

Calls 2

helperFunction · 0.85
initMethod · 0.65

Tested by

no test coverage detected