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
+6-4Lines changed: 6 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,8 +2,7 @@
2
2
3
3
## Introduction
4
4
5
-
`friendsofhyperf/amqp-job` is an asynchronous job component based on the `hyperf/amqp` component. It supports dispatching jobs to an AMQP service and then consuming the jobs through consumers.
6
-
It encapsulates the `hyperf/amqp` component and provides a more convenient way to dispatch and consume jobs.
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.
Copy file name to clipboardExpand all lines: en/components/compoships.md
+15-15Lines changed: 15 additions & 15 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 based on two (or more) columns in Hyperf's Model ORM. The need to match multiple columns in Eloquent relationship definitions often arises when dealing with third-party or pre-existing schemas/databases.
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.
4
4
5
-
## Problem
5
+
## Issue
6
6
7
-
Eloquent doesn't support composite keys. Therefore, it's not possible to define a relationship from one model to another by matching multiple columns. Attempting to use a `where` clause (as shown in the example below) won't work with eagerloading relationships because **$this->team_id** is null when processing the relationship.
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.
8
8
9
9
```php
10
10
namespace App;
@@ -23,27 +23,27 @@ class User extends Model
23
23
24
24
## Installation
25
25
26
-
It's recommended to install **Compoships**component through[Composer](http://getcomposer.org/).
26
+
It is recommended to install the **Compoships**package via[Composer](http://getcomposer.org/).
27
27
28
28
```shell
29
29
composer require friendsofhyperf/compoships
30
30
```
31
31
32
32
## Usage
33
33
34
-
### Using `FriendsOfHyperf\Compoships\Database\Eloquent\Model` Class
34
+
### Using the `FriendsOfHyperf\Compoships\Database\Eloquent\Model` Class
35
35
36
-
Simply make your model class derive from the `FriendsOfHyperf\Compoships\Database\Eloquent\Model` base class. `FriendsOfHyperf\Compoships\Database\Eloquent\Model` extends the `Eloquent` base class without changing its core functionality.
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.
37
37
38
-
### Using `FriendsOfHyperf\Compoships\Compoships` Trait
38
+
### Using the `FriendsOfHyperf\Compoships\Compoships` Trait
39
39
40
-
If for some reason you can't derive your models from `FriendsOfHyperf\Compoships\Database\Eloquent\Model`, you can use the `FriendsOfHyperf\Compoships\Compoships` trait. Simply use this trait in your models.
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.
41
41
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**
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**.
43
43
44
-
### Usage
44
+
### How It Works
45
45
46
-
... Now we can define relationships from model *A* to another model *B* by matching two or more columns (by passing arrays of columns instead of a string).
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
48
48
```php
49
49
namespace App;
@@ -61,7 +61,7 @@ class A extends Model
61
61
}
62
62
```
63
63
64
-
We can use the same syntax to define the inverse of the relationship:
64
+
We can use the same syntax to define the inverse relationship:
65
65
66
66
```php
67
67
namespace App;
@@ -81,15 +81,15 @@ class B extends Model
81
81
82
82
### Example
83
83
84
-
As an example, let's say we have a task list with categories managed by multiple user teams where:
84
+
For example, suppose we have a task list with categories that are 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
90
- A user is responsible for tasks in a category
91
91
92
-
The user responsible for a specific task is the user currently responsible for that category within their team.
92
+
The user responsible for a specific task is the current user in charge of 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 can be used to define the inverse of the relationship:
110
+
The same syntax applies to defining the inverse relationship:
Copy file name to clipboardExpand all lines: en/components/console-spinner.md
+3-3Lines changed: 3 additions & 3 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
-
The progress bar component For Hyperf.
3
+
A progress bar component for the Hyperf framework.
4
4
5
5
## Installation
6
6
@@ -37,10 +37,10 @@ class FooCommand extends Command
37
37
}
38
38
```
39
39
40
-
The `$spinner` is compatible with Symfony ProgressBar, so you can run any method of this class. Alternatively, you can also use the `withSpinner` method by providing an iterable object.
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.
0 commit comments