You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: en/components/amqp-job.md
+5-2Lines changed: 5 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
## Introduction
4
4
5
-
`friendsofhyperf/amqp-job` is an asynchronous task component built on the `hyperf/amqp`package. It supports distributing tasks to the AMQP service and consuming these tasks through consumers. It encapsulates the `hyperf/amqp`package and provides a more convenient way to distribute and consume tasks.
5
+
`friendsofhyperf/amqp-job` is an asynchronous task component based on the `hyperf/amqp`component. It supports dispatching tasks to an AMQP service, which are then consumed by consumers. By encapsulating the `hyperf/amqp`component, it provides a more convenient way to dispatch and consume tasks.
6
6
7
7
## Installation
8
8
@@ -35,9 +35,10 @@ class FooJob extends Job
35
35
}
36
36
37
37
dispatch(new FooJob());
38
+
38
39
```
39
40
40
-
### Registering a Consumer[Optional]
41
+
### Registering Consumers[Optional]
41
42
42
43
```php
43
44
@@ -52,9 +53,11 @@ use Hyperf\Amqp\Annotation\Consumer;
Copy file name to clipboardExpand all lines: en/components/compoships.md
+13-13Lines changed: 13 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,10 @@
1
1
# Compoships
2
2
3
-
**Compoships** provides the ability to specify relationships in Hyperf's Model ORM based on two (or more) columns. This is commonly needed when working with third-party or pre-existing schemas/databases where relationships in Eloquent are defined by matching multiple columns.
3
+
**Compoships** provides the ability to define relationships based on two (or more) columns in Hyperf's Model ORM. When dealing with third-party or pre-existing schemas/databases, there is often a need to match multiple columns in the definition of Eloquent relationships.
4
4
5
-
## Issue
5
+
## Problem
6
6
7
-
Eloquent does not support composite keys. As a result, it is not possible to define relationships from one model to another by matching multiple columns. Attempting to use a `where`clause (as shown below) will not work when eager-loading the relationship, because **$this->team_id** is null during relationship processing.
7
+
Eloquent does not support composite keys. Therefore, it is not possible to define relationships from one model to another by matching multiple columns. Attempting to use `where`clauses (as shown in the example below) does not work when eagerloading relationships because **$this->team_id** is null when handling the relationship.
8
8
9
9
```php
10
10
namespace App;
@@ -23,7 +23,7 @@ class User extends Model
23
23
24
24
## Installation
25
25
26
-
It is recommended to install the **Compoships**package via[Composer](http://getcomposer.org/).
26
+
It is recommended to install the **Compoships**component using[Composer](http://getcomposer.org/).
### Using the `FriendsOfHyperf\Compoships\Database\Eloquent\Model` Class
35
35
36
-
Simply extend your model class from the `FriendsOfHyperf\Compoships\Database\Eloquent\Model` base class. `FriendsOfHyperf\Compoships\Database\Eloquent\Model` extends the `Eloquent` base class without altering its core functionality.
36
+
Simply have your model classes extend the `FriendsOfHyperf\Compoships\Database\Eloquent\Model` base class. `FriendsOfHyperf\Compoships\Database\Eloquent\Model` extends the `Eloquent` base class without altering its core functionality.
37
37
38
38
### Using the `FriendsOfHyperf\Compoships\Compoships` Trait
39
39
40
-
If, for some reason, you cannot extend your model from `FriendsOfHyperf\Compoships\Database\Eloquent\Model`, you can use the `FriendsOfHyperf\Compoships\Compoships` trait. Simply include the trait in your model.
40
+
If for some reason you cannot extend `FriendsOfHyperf\Compoships\Database\Eloquent\Model` in your model, you can use the `FriendsOfHyperf\Compoships\Compoships` trait. Simply use this trait in your model.
41
41
42
-
**Note:** To define multi-column relationships from model *A* to another model *B*, **both models must either extend `FriendsOfHyperf\Compoships\Database\Eloquent\Model` or use the `FriendsOfHyperf\Compoships\Compoships` trait**.
42
+
**Note:** To define a multi-column relationship from model *A* to another model *B*, **both models must extend `FriendsOfHyperf\Compoships\Database\Eloquent\Model` or use the `FriendsOfHyperf\Compoships\Compoships` trait**
43
43
44
-
### How It Works
44
+
### Usage
45
45
46
46
... Now we can define relationships from model *A* to another model *B* by matching two or more columns (by passing an array of columns instead of a string).
47
47
@@ -81,15 +81,15 @@ class B extends Model
81
81
82
82
### Example
83
83
84
-
For example, suppose we have a task list with categories that are managed by multiple user teams, where:
84
+
As an example, suppose we have a task list with categories, managed by multiple user teams, where:
85
85
86
86
- A task belongs to a category
87
87
- A task is assigned to a team
88
88
- A team has many users
89
89
- A user belongs to a team
90
-
- A user is responsible for tasks in a category
90
+
- A user is responsible for a category's tasks
91
91
92
-
The user responsible for a specific task is the current user in charge of that category within the team.
92
+
The user responsible for a specific task is the currently responsible user for that category within the team.
93
93
94
94
```php
95
95
namespace App;
@@ -107,7 +107,7 @@ class User extends Model
107
107
}
108
108
```
109
109
110
-
The same syntax applies to defining the inverse relationship:
110
+
The same syntax can be used to define the inverse relationship:
Copy file name to clipboardExpand all lines: en/components/console-spinner.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Console Spinner
2
2
3
-
A progress bar component for the Hyperf framework.
3
+
A progress bar component provided for the Hyperf framework.
4
4
5
5
## Installation
6
6
@@ -37,7 +37,7 @@ class FooCommand extends Command
37
37
}
38
38
```
39
39
40
-
The `$spinner` is compatible with Symfony ProgressBar, so you can call any method of that class. Alternatively, you can use the `withSpinner` method by providing an iterable object.
40
+
`$spinner` is compatible with Symfony ProgressBar, so you can run any methods from this class. Alternatively, you can use the `withSpinner` method by providing an iterable object.
0 commit comments