LoadedReference <T>
Hierarchy
- Reference<NonNullable<T>>
- LoadedReference
Index
Properties
$
Methods
get
Returns NonNullable<T>
inheritedgetEntity
Returns NonNullable<T>
inheritedgetProperty
Parameters
prop: K
Returns NonNullable<T>[K]
inheritedisInitialized
Returns boolean
inheritedload
Parameters
options: LoadReferenceOptions<TT, P, F, E> = {}
Returns Promise<null | Loaded<TT, P, F, E>>
inheritedloadOrFail
Ensures the underlying entity is loaded first (without reloading it if it already is loaded). Returns the entity or throws an error just like
em.findOneOrFail()
(and respects the same config options).Parameters
options: LoadReferenceOrFailOptions<TT, P, F, E> = {}
Returns Promise<Loaded<TT, P, F, E>>
inheritedloadProperty
Parameters
prop: K
optionaloptions: LoadReferenceOrFailOptions<TT, P, *, never>
Returns Promise<Loaded<TT, P>[K]>
inheritedpopulated
Parameters
optionalpopulated: boolean
Returns void
inheritedtoJSON
Parameters
rest...args: any[]
Returns Dictionary
inheritedunwrap
Returns NonNullable<T>
Ensures the underlying entity is loaded first (without reloading it if it already is loaded). Returns the entity. If the entity is not found in the database (e.g. it was deleted in the meantime, or currently active filters disallow loading of it) the method returns
null
. UseloadOrFail()
if you want an error to be thrown in such a case.