Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

Commit 7b31d21

Browse files
committed
docs: clarifications for service key
Clarifies the section covering using a PDO service name: - Specifies which version first offers the functionality. - Details that the `service` key overrides the `dsn` key. - Points out the changed line in the configuration. - Minor verbiage changes for clarity.
1 parent 09888b1 commit 7b31d21

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

docs/book/v1/user-repository.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,14 +123,17 @@ SELECT email FROM user WHERE username = :identity
123123

124124
### PDO service name
125125

126+
> Since 1.1.0
127+
126128
As an alternative, you can provide a service name instead of PDO connection
127-
parameters. In such a case, the `dsn` parameter can be omitted:
129+
parameters. In such a case, you can substitute the key `service` for the `dsn`
130+
configuration key:
128131

129132
```php
130133
return [
131134
'authentication' => [
132135
'pdo' => [
133-
'service' => \PDO::class,
136+
'service' => \PDO::class, // "service" instead of "dsn"
134137
'table' => 'user table name',
135138
'field' => [
136139
'identity' => 'identity field name',
@@ -143,6 +146,8 @@ return [
143146
];
144147
```
145148

146-
The required parameters are `service`, `table`, and `field`.
149+
The parameters `table` and `field` still remain required, and one or the other
150+
of `dsn` or `service` **MUST** be present.
147151

148-
The `service` parameter must be a service name that resolves to a PDO instance.
152+
When specifying the `service` key, the value **MUST** evaluate to an existing
153+
service that resolves to a `PDO` instance.

0 commit comments

Comments
 (0)