You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
608 B
20 lines
608 B
import ModelResultOperator from "./ModelResultOperator.ts";
|
|
import {Model} from "./Model.ts";
|
|
import Instantiable from "../../../di/src/type/Instantiable.ts";
|
|
import {HasOne} from "./relation/HasOne.ts";
|
|
import {QueryRow} from "../db/types.ts";
|
|
|
|
export default class RelationResultOperator<T extends Model<T>> extends ModelResultOperator<T> {
|
|
constructor(
|
|
protected ModelClass: Instantiable<T>,
|
|
protected relation: HasOne<any, T>,
|
|
) {
|
|
super(ModelClass)
|
|
}
|
|
|
|
inflate_row(row: QueryRow): T {
|
|
const instance = super.inflate_row(row)
|
|
return instance
|
|
}
|
|
}
|