Skip to main content

@webda/coreReadme | API


Class: ModelLink<T>

Define a link to 1:n relation

Type parameters

T extends CoreModel

Implements

Constructors

new ModelLink(uuid, model, parent)

new ModelLink<T>(uuid, model, parent?): ModelLink<T>

Parameters

uuid: string

model: CoreModelDefinition<T>

parent?: CoreModel

Returns

ModelLink<T>

Source

packages/core/src/models/relations.ts:72

Properties

model

protected model: CoreModelDefinition<T>

Source

packages/core/src/models/relations.ts:74


parent

protected parent: CoreModel

Source

packages/core/src/models/relations.ts:70


uuid

protected uuid: string

Source

packages/core/src/models/relations.ts:73

Methods

get()

get(): Promise<T>

Returns

Promise<T>

Source

packages/core/src/models/relations.ts:80


getUuid()

getUuid(): string

Returns

string

Source

packages/core/src/models/relations.ts:99


set()

set(id): void

Parameters

id: string | T

Returns

void

Source

packages/core/src/models/relations.ts:83


toJSON()

toJSON(): string

Returns

string

Source

packages/core/src/models/relations.ts:96


toString()

toString(): string

Returns

string

Source

packages/core/src/models/relations.ts:93