Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor(
db: juggler.DataSource,
orderRepositoryGetter: Getter,
addressRepositoryGetter: Getter,
) {
super(Customer, db);
const ordersMeta = this.entityClass.definition.relations['orders'];
// create a has-many relation through this public method
this.orders = createHasManyRepositoryFactory(
ordersMeta as HasManyDefinition,
orderRepositoryGetter,
);
const addressMeta = this.entityClass.definition.relations['address'];
this.address = createHasOneRepositoryFactory(
addressMeta as HasOneDefinition,
addressRepositoryGetter,
);
const customersMeta = this.entityClass.definition.relations['customers'];
this.customers = createHasManyRepositoryFactory(
customersMeta as HasManyDefinition,
Getter.fromValue(this),
);
const parentMeta = this.entityClass.definition.relations['parent'];
this.parent = createBelongsToAccessor(
) {
super(Customer, db);
const ordersMeta = this.entityClass.definition.relations['orders'];
// create a has-many relation through this public method
this.orders = createHasManyRepositoryFactory(
ordersMeta as HasManyDefinition,
orderRepositoryGetter,
);
const addressMeta = this.entityClass.definition.relations['address'];
this.address = createHasOneRepositoryFactory(
addressMeta as HasOneDefinition,
addressRepositoryGetter,
);
const customersMeta = this.entityClass.definition.relations['customers'];
this.customers = createHasManyRepositoryFactory(
customersMeta as HasManyDefinition,
Getter.fromValue(this),
);
const parentMeta = this.entityClass.definition.relations['parent'];
this.parent = createBelongsToAccessor(
parentMeta as BelongsToDefinition,
Getter.fromValue(this),
this,
);
}
};
constructor(
db: juggler.DataSource,
orderRepositoryGetter: Getter,
) {
super(Shipment, db);
const ordersMeta = this.entityClass.definition.relations[
'shipmentOrders'
];
this.orders = createHasManyRepositoryFactory(
ordersMeta as HasManyDefinition,
orderRepositoryGetter,
);
}
};