Class HasSubtree<T>

A relation that recursively loads the subtree of a model using modified preorder traversal.

Type Parameters

Hierarchy

Constructors

Properties

instances: Maybe<Collection<T>>

When the relation is loaded, the immediate children of the node.

leftTreeField: string
logging: Logging
model: T
parent: T

The model related from.

related: T

The model related to.

Accessors

Methods

  • Instantiate a new injectable using the container.

    Type Parameters

    • T

    Parameters

    • target: any
    • Rest ...parameters: any[]

    Returns T

  • 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: Collection<T>) => unknown)
    • reject: ((e: Error) => unknown)
        • (e: Error): unknown
        • Parameters

          • e: Error

          Returns unknown

    Returns void