Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SingleModelRelation<Parent, Related, RelatedClass> Abstract

Type Parameters

Hierarchy

Index

Constructors

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

Properties

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

Accessors

  • get loaded(): boolean

Methods

  • addRelated(related: Related): void
  • attach(model?: Related): Related
  • attach(attributes: Attributes): Related
  • disable(): void
  • enable(): void
  • getLoadedModels(): Related[]
  • getModels(): Promise<Related[]>
  • initializeInverseRelations(model: Related): void
  • isEmpty(): null | boolean
  • isRelated(related: Related): boolean
  • load(): Promise<null | Related>
  • resolve(): Promise<null | Related | Related[]>
  • setForeignAttributes(related: Related): void
  • unload(): void

Generated using TypeDoc