---
lang: en
title: 'API docs: repository.defaulthasmanythroughrepository._constructor_'
keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI
sidebar: lb4_sidebar
editurl: https://github.com/strongloop/loopback-next/tree/master/packages/repository
permalink: /doc/en/lb4/apidocs.repository.defaulthasmanythroughrepository._constructor_.html
---

<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@loopback/repository](./repository.md) &gt; [DefaultHasManyThroughRepository](./repository.defaulthasmanythroughrepository.md) &gt; [(constructor)](./repository.defaulthasmanythroughrepository._constructor_.md)

## DefaultHasManyThroughRepository.(constructor)

Constructs a new instance of the `DefaultHasManyThroughRepository` class

<b>Signature:</b>

```typescript
constructor(getTargetRepository: Getter<TargetRepository>, getThroughRepository: Getter<ThroughRepository>, getTargetConstraintFromThroughModels: (throughInstances: ThroughEntity[]) => DataObject<TargetEntity>, getTargetKeys: (throughInstances: ThroughEntity[]) => TargetID[], getThroughConstraintFromSource: () => DataObject<ThroughEntity>, getTargetIds: (targetInstances: TargetEntity[]) => TargetID[], getThroughConstraintFromTarget: (targetID: TargetID[]) => DataObject<ThroughEntity>);
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  getTargetRepository | [Getter](./context.getter.md)<!-- -->&lt;TargetRepository&gt; |  |
|  getThroughRepository | [Getter](./context.getter.md)<!-- -->&lt;ThroughRepository&gt; |  |
|  getTargetConstraintFromThroughModels | (throughInstances: ThroughEntity\[\]) =&gt; [DataObject](./repository.dataobject.md)<!-- -->&lt;TargetEntity&gt; |  |
|  getTargetKeys | (throughInstances: ThroughEntity\[\]) =&gt; TargetID\[\] |  |
|  getThroughConstraintFromSource | () =&gt; [DataObject](./repository.dataobject.md)<!-- -->&lt;ThroughEntity&gt; |  |
|  getTargetIds | (targetInstances: TargetEntity\[\]) =&gt; TargetID\[\] |  |
|  getThroughConstraintFromTarget | (targetID: TargetID\[\]) =&gt; [DataObject](./repository.dataobject.md)<!-- -->&lt;ThroughEntity&gt; |  |


