Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Relation<Parent, Related, RelatedClass> Abstract

Type Parameters

Hierarchy

Index

Constructors

  • new Relation<Parent, Related, RelatedClass>(parent: Parent, relatedClass: RelatedClass, foreignKeyName: string, localKeyName?: string): Relation<Parent, Related, RelatedClass>

Properties

deleteStrategy: RelationDeleteStrategy = null
enabled: boolean = true
foreignKeyName: string
localKeyName: string
name: string
parent: Parent
related?: null | Related | Related[]
relatedClass: RelatedClass
inverseRelationClasses: Constructor<Relation<Model, Model, ModelConstructor<Model>>>[] = []

Accessors

  • get loaded(): boolean

Methods

  • addRelated(related: Related): void
  • clone(options?: Partial<{ clones: WeakMap<Model, Model>; constructors: WeakMap<typeof Model, typeof Model> }>): Relation<Parent, Related, RelatedClass>
  • disable(): void
  • enable(): void
  • getLoadedModels(): Related[]
  • getModels(): Promise<Related[]>
  • initializeInverseRelations(model: Related): void
  • isEmpty(): null | boolean
  • isRelated(model: Related): boolean
  • load(): Promise<null | Related | Related[]>
  • resolve(): Promise<null | Related | Related[]>
  • setForeignAttributes(related: Related): void
  • unload(): void

Generated using TypeDoc