Documentation / zerotal / orm / MorphToOptions
Interface: MorphToOptions
Defined in: packages/orm/src/model/decorators/morphTo.ts:3
Properties
morphMap
morphMap:
Record<string, () =>unknown>
Defined in: packages/orm/src/model/decorators/morphTo.ts:5
Maps the discriminator string stored in the _type column to the model factory.
morphTypeColumn?
optionalmorphTypeColumn?:string
Defined in: packages/orm/src/model/decorators/morphTo.ts:10
Override the _type column name. Defaults to <propertyName>_type.
e.g. property commentable → commentable_type.
morphForeignKey?
optionalmorphForeignKey?:string
Defined in: packages/orm/src/model/decorators/morphTo.ts:15
Override the _id column name. Defaults to <propertyName>_id.
e.g. property commentable → commentable_id.