Class MultiAssociation<S, T, ForeignKey, TargetKey, Opts>Abstract Private

Type Parameters

Hierarchy

Constructors

Properties

accessors: Record<string, string>
foreignKey: ForeignKey
isAliased: boolean
isSelfAssociation: boolean
options: Opts
parentAssociation: null | Association<Model<any, any>, Model<any, any>, string, NormalizedAssociationOptions<string>>

A reference to the association that created this one.

source: ModelStatic<S>
target: ModelStatic<T>

Accessors

  • get as(): string
  • The identifier of the relation on the source model.

    Returns string

  • get associationType(): string
  • The type of the association. One of HasMany, BelongsTo, HasOne, BelongsToMany

    Returns string

  • get isMultiAssociation(): boolean
  • Returns boolean

  • get isSingleAssociation(): boolean
  • Deprecated

    negate isMultiAssociation instead

    Returns boolean

  • get name(): {
        plural: string;
        singular: string;
    }
  • Returns {
        plural: string;
        singular: string;
    }

    • plural: string
    • singular: string
  • get isMultiAssociation(): boolean
  • Returns boolean

Methods

  • Private

    Normalize input

    Returns

    built objects

    Parameters

    • input: AllowArray<T | Exclude<T[TargetKey], any[]>>

      it may be array or single obj, instance or primary key

    Returns T[]

Generated using TypeDoc