diff --git a/docs/en-US/api/database/relation-repository/has-many-repository.md b/docs/en-US/api/database/relation-repository/has-many-repository.md index 2e4b2be42..0ab255d22 100644 --- a/docs/en-US/api/database/relation-repository/has-many-repository.md +++ b/docs/en-US/api/database/relation-repository/has-many-repository.md @@ -1,42 +1,41 @@ # HasManyRepository -`HasManyRepository` 是用于处理 `HasMany` 关系的 `Relation Repository`。 +`HasManyRepository` is the `Relation Repository` for handling `HasMany` relationships. -## 类方法 +## Class Method ### `find()` -查找关联对象 +Find associated objects. -**签名** +**Signature** * `async find(options?: FindOptions): Promise` -**详细信息** +**Detailed Information** -查询参数与 [`Repository.find()`](../repository.md#find) 一致。 +Query parameters are the same as [`Repository.find()`](../repository.md#find). ### `findOne()` -查找关联对象,仅返回一条记录 +Find associated objects, only to return one record. -**签名** +**Signature** * `async findOne(options?: FindOneOptions): Promise` - ### `count()` -返回符合查询条件的记录数 +Return the number of records matching the query criteria. -**签名** +**Signature** * `async count(options?: CountOptions)` -**类型** +**Type** ```typescript interface CountOptions extends Omit, Transactionable { filter?: Filter; @@ -45,23 +44,22 @@ interface CountOptions extends Omit` -**类型** +**Type** ```typescript type FindAndCountOptions = CommonFindOptions ``` - ### `create()` -创建关联对象 +Create associated objects. -**签名** +**Signature** * `async create(options?: CreateOptions): Promise` @@ -69,9 +67,9 @@ type FindAndCountOptions = CommonFindOptions ### `update()` -更新符合条件的关联对象 +Update associated objects that match the conditions. -**签名** +**Signature** * `async update(options?: UpdateOptions): Promise` @@ -79,9 +77,9 @@ type FindAndCountOptions = CommonFindOptions ### `destroy()` -删除符合条件的关联对象 +Delete associated objects. -**签名** +**Signature** * `async destroy(options?: TK | DestroyOptions): Promise` @@ -89,44 +87,43 @@ type FindAndCountOptions = CommonFindOptions ### `add()` -添加对象关联关系 +Add association relationships between objects. -**签名** +**Signature** * `async add(options: TargetKey | TargetKey[] | AssociatedOptions)` -**类型** +**Type** ```typescript interface AssociatedOptions extends Transactionable { tk?: TargetKey | TargetKey[]; } ``` -**详细信息** +**Detailed Information** -* `tk` - 关联对象的 targetKey 值,可以是单个值,也可以是数组。 +* `tk` - The targetKey value of the associated object, either as a single value or an array. ### `remove()` -移除与给定对象之间的关联关系 +Remove the association with the given object. + +**Signature** -**签名** * `async remove(options: TargetKey | TargetKey[] | AssociatedOptions)` -**详细信息** +**Detailed Information** -参数同 [`add()`](#add) 方法。 +Same parameters as the [`add()`](#add) method. ### `set()` -设置当前关系的关联对象 +Set the associated object of the current relationship. -**签名** +**Signature** * `async set(options: TargetKey | TargetKey[] | AssociatedOptions)` -**详细信息** - -参数同 [`add()`](#add) 方法。 - +**Detailed Information** +Same parameters as the [`add()`](#add) method.