import {Model} from '../Model.ts' import {HasOneOrMany} from './HasOneOrMany.ts' import {Collection} from '../../../../lib/src/collection/Collection.ts' export class HasMany, T2 extends Model> extends HasOneOrMany { protected _value?: Collection protected _loaded = false public async get(): Promise> { return this.fetch().collect() } public set_value(related: Collection) { this._loaded = true this._value = related.clone() } public get_value(): Collection | undefined { return this._value } public is_loaded(): boolean { return this._loaded } }