From 473f7c6465b5ac7b43cb110cbff604beda3fba7b Mon Sep 17 00:00:00 2001 From: soyuka Date: Tue, 27 Jan 2026 16:36:44 +0100 Subject: [PATCH] cs --- core/dto.md | 9 ++++++--- core/identifiers.md | 9 ++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/core/dto.md b/core/dto.md index ccdad0ded8c..bf8c36067aa 100644 --- a/core/dto.md +++ b/core/dto.md @@ -14,9 +14,12 @@ In API Platform, [the general design considerations](design.md) recommended patt This reference covers three implementation strategies: -- For automated CRUD operations, link a DTO Resource to an Entity: [State Options](#1-the-dto-resource-state-options) -- For automated Write operation, use input DTOs with stateOptions: [Automated Mapped Inputs](#2-automated-mapped-inputs-and-outputs) -- For specific business actions, use input DTOs with custom State Processors : [Custom Business Logic](#3-custom-business-logic-custom-processor) +- For automated CRUD operations, link a DTO Resource to an Entity: + [State Options](#1-the-dto-resource-state-options) +- For automated Write operation, use input DTOs with stateOptions: + [Automated Mapped Inputs](#2-automated-mapped-inputs-and-outputs) +- For specific business actions, use input DTOs with custom State Processors : + [Custom Business Logic](#3-custom-business-logic-custom-processor) ## 1. The DTO Resource (State Options) diff --git a/core/identifiers.md b/core/identifiers.md index 297095d57d3..66ed192155c 100644 --- a/core/identifiers.md +++ b/core/identifiers.md @@ -174,7 +174,10 @@ Your `PersonProvider` will now work as expected! ## Decorating the IdentifiersExtractor -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`. +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`. Let's say you want to format all `\DateTime` identifiers to `Y-m-d`. @@ -220,8 +223,8 @@ Then, configure the service decoration in your `services.yaml`: # api/config/services.yaml services: App\Identifier\DateTimeIdentifiersExtractor: - decorates: 'api_platform.identifiers.identifiers_extractor' - arguments: ['@.inner'] + decorates: "api_platform.identifiers.identifiers_extractor" + arguments: ["@.inner"] public: false ```