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,
customerRepositoryGetter: Getter,
) {
super(Address, db);
// create a belongsto relation from this public method
const customerMeta = this.entityClass.definition.relations['customer'];
this.customer = createBelongsToAccessor(
customerMeta as BelongsToDefinition,
customerRepositoryGetter,
this,
);
}
};
constructor(
db: juggler.DataSource,
customerRepositoryGetter: Getter,
shipmentRepositoryGetter: Getter,
) {
super(Order, db);
const customerMeta = this.entityClass.definition.relations['customer'];
this.customer = createBelongsToAccessor(
customerMeta as BelongsToDefinition,
customerRepositoryGetter,
this,
);
const shipmentrMeta = this.entityClass.definition.relations['shipment'];
this.shipment = createBelongsToAccessor(
shipmentrMeta as BelongsToDefinition,
shipmentRepositoryGetter,
this,
);
}
};
function givenAccessor() {
findCustomerOfOrder = createBelongsToAccessor(
Order.definition.relations.customer as BelongsToDefinition,
Getter.fromValue(customerRepo),
orderRepo,
);
}
});
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,
customerRepositoryGetter: Getter,
shipmentRepositoryGetter: Getter,
) {
super(Order, db);
const customerMeta = this.entityClass.definition.relations['customer'];
this.customer = createBelongsToAccessor(
customerMeta as BelongsToDefinition,
customerRepositoryGetter,
this,
);
const shipmentrMeta = this.entityClass.definition.relations['shipment'];
this.shipment = createBelongsToAccessor(
shipmentrMeta as BelongsToDefinition,
shipmentRepositoryGetter,
this,
);
}
};