Loads the entity if needed, then returns the value of the specified property.
(
prop: K,
options?: LoadReferenceOrFailOptions<TT, P>,
)
| 214 | |
| 215 | /** Loads the entity if needed, then returns the value of the specified property. */ |
| 216 | async loadProperty<TT extends T, P extends string = never, K extends keyof TT = keyof TT>( |
| 217 | prop: K, |
| 218 | options?: LoadReferenceOrFailOptions<TT, P>, |
| 219 | ): Promise<Loaded<TT, P>[K]> { |
| 220 | await this.loadOrFail(options); |
| 221 | return (this.getEntity() as TT)[prop] as Loaded<TT, P>[K]; |
| 222 | } |
| 223 | |
| 224 | /** Returns whether the underlying entity has been fully loaded from the database. */ |
| 225 | isInitialized(): boolean { |
no test coverage detected