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

Method findProperty

packages/core/src/utils/QueryHelper.ts:485–493  ·  view source on GitHub ↗
(fieldName: string, options: ProcessWhereOptions<T>)

Source from the content-addressed store, hash-verified

483 }
484
485 static findProperty<T>(fieldName: string, options: ProcessWhereOptions<T>): EntityProperty<T> | undefined {
486 const parts = fieldName.split('.');
487 const propName = parts.pop() as EntityKey<T>;
488 const alias = parts.length > 0 ? parts.join('.') : undefined;
489 const entityName = alias ? options.aliasMap?.[alias] : options.entityName;
490 const meta = entityName ? options.metadata.find<T>(entityName) : undefined;
491
492 return meta?.properties[propName];
493 }
494
495 /**
496 * Converts entity references for composite FK properties into flat arrays

Callers 2

processWhereMethod · 0.95

Calls 2

joinMethod · 0.65
findMethod · 0.65

Tested by

no test coverage detected