Skip to content

Commit 2d2a5dd

Browse files
authored
cs (#2246)
1 parent fa2534e commit 2d2a5dd

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

core/dto.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,12 @@ In API Platform, [the general design considerations](design.md) recommended patt
1414

1515
This reference covers three implementation strategies:
1616

17-
- For automated CRUD operations, link a DTO Resource to an Entity: [State Options](#1-the-dto-resource-state-options)
18-
- For automated Write operation, use input DTOs with stateOptions: [Automated Mapped Inputs](#2-automated-mapped-inputs-and-outputs)
19-
- For specific business actions, use input DTOs with custom State Processors : [Custom Business Logic](#3-custom-business-logic-custom-processor)
17+
- For automated CRUD operations, link a DTO Resource to an Entity:
18+
[State Options](#1-the-dto-resource-state-options)
19+
- For automated Write operation, use input DTOs with stateOptions:
20+
[Automated Mapped Inputs](#2-automated-mapped-inputs-and-outputs)
21+
- For specific business actions, use input DTOs with custom State Processors :
22+
[Custom Business Logic](#3-custom-business-logic-custom-processor)
2023

2124
## 1. The DTO Resource (State Options)
2225

core/identifiers.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,10 @@ Your `PersonProvider` will now work as expected!
174174

175175
## Decorating the IdentifiersExtractor
176176

177-
The `IdentifiersExtractor` is responsible for extracting identifiers from a resource. By default, when `\DateTime` objects are used as identifiers, their serialization to `IRI` format is handled by the `DateTimeUriVariableTransformer`, which internally uses Symfony's `DateTimeNormalizer`. If you need a custom format, you can decorate the `IdentifiersExtractor`.
177+
The `IdentifiersExtractor` is responsible for extracting identifiers from a resource. By default,
178+
when `\DateTime` objects are used as identifiers, their serialization to `IRI` format is handled by
179+
the `DateTimeUriVariableTransformer`, which internally uses Symfony's `DateTimeNormalizer`. If you
180+
need a custom format, you can decorate the `IdentifiersExtractor`.
178181

179182
Let's say you want to format all `\DateTime` identifiers to `Y-m-d`.
180183

@@ -220,8 +223,8 @@ Then, configure the service decoration in your `services.yaml`:
220223
# api/config/services.yaml
221224
services:
222225
App\Identifier\DateTimeIdentifiersExtractor:
223-
decorates: 'api_platform.identifiers.identifiers_extractor'
224-
arguments: ['@.inner']
226+
decorates: "api_platform.identifiers.identifiers_extractor"
227+
arguments: ["@.inner"]
225228
public: false
226229
```
227230

0 commit comments

Comments
 (0)