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

Method create

packages/core/src/entity/EntityAssigner.ts:361–366  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

359 }
360
361 const create = () =>
362 EntityAssigner.validateEM(em) &&
363 em.getEntityFactory().createEmbeddable<T>(prop.targetMeta!.class, value, {
364 convertCustomTypes: options.convertCustomTypes,
365 newEntity: options.mergeEmbeddedProperties ? !('propName' in entity) : true,
366 });
367 entity[propName] = (options.mergeEmbeddedProperties ? entity[propName] || create() : create()) as EntityValue<T>;
368
369 Object.keys(value).forEach(key => {

Callers

nothing calls this directly

Calls 3

validateEMMethod · 0.80
createEmbeddableMethod · 0.80
getEntityFactoryMethod · 0.80

Tested by

no test coverage detected