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

Method findProperty

packages/sql/src/plugin/transformer.ts:725–735  ·  view source on GitHub ↗
(meta: EntityMetadata | undefined, columnName?: string)

Source from the content-addressed store, hash-verified

723 }
724
725 findProperty(meta: EntityMetadata | undefined, columnName?: string): EntityProperty | undefined {
726 if (!meta || !columnName) {
727 return undefined;
728 }
729
730 if (meta.properties[columnName]) {
731 return meta.properties[columnName];
732 }
733
734 return meta.props.find(prop => prop.fieldNames?.includes(columnName));
735 }
736
737 prepareInputValue(prop: EntityProperty | undefined, value: unknown, enabled: boolean): unknown {
738 if (!enabled || !prop || value == null) {

Callers 6

processOnCreateHooksMethod · 0.95
processOnUpdateHooksMethod · 0.95
processUpdateValuesMethod · 0.95
expandSelectionMethod · 0.95
buildFieldsFunction · 0.45

Calls 1

findMethod · 0.65

Tested by

no test coverage detected