Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Relation<T, T2, V>

Base class for inter-model relation implementations.

Type parameters

Hierarchy

Index

Constructors

Protected constructor

  • new Relation<T, T2, V>(parent: T, related: T2): Relation<T, T2, V>

Properties

Protected parent

parent: T

Readonly related

related: T2

Accessors

Protected Abstract parentValue

  • get parentValue(): any

relatedQuerySource

value

  • get value(): V

Methods

Abstract applyScope

Abstract buildEagerQuery

builder

fetch

Abstract get

  • get(): Promise<V>

getContainer

Abstract getValue

  • getValue(): V

Abstract isLoaded

  • isLoaded(): boolean

make

  • make<T>(target: any, ...parameters: any[]): T

Abstract matchResults

Abstract query

setContainer

Abstract setValue

  • setValue(related: V): void

then

  • then(resolve: (result: V) => unknown, reject: (e: Error) => unknown): void
  • Makes the relation "thenable" so relation methods on models can be awaited to yield the result of the relation.

    example
    const rows = await myModelInstance.myHasManyRelation()  -- rows is a Collection
    

    Parameters

    • resolve: (result: V) => unknown
        • (result: V): unknown
        • Parameters

          • result: V

          Returns unknown

    • reject: (e: Error) => unknown
        • (e: Error): unknown
        • Parameters

          • e: Error

          Returns unknown

    Returns void

Extollo Logo

extollo (v. latin) - to lift up, to elevate

Extollo is a free & libre application framework in TypeScript.