Options
All
  • Public
  • Public/Protected
  • All
Menu

Class HasManyRelation<Parent, Related, RelatedClass>

Type Parameters

Hierarchy

Index

Constructors

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

Properties

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

Accessors

  • get loaded(): boolean

Methods

  • addRelated(related: Related): void
  • assertLoaded(method: string): this is { related: Related[] }
  • 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(model: Related): boolean
  • load(): Promise<Related[]>
  • resolve(): Promise<null | Related | Related[]>
  • setForeignAttributes(related: Related): void
  • unload(): void

Generated using TypeDoc