From d65b388dc5d16d69753e2da3e97188eb5bff49b9 Mon Sep 17 00:00:00 2001 From: Saeed Asalisaf Date: Tue, 18 Feb 2025 09:42:29 +0330 Subject: [PATCH] Update identifiers.md --- core/identifiers.md | 54 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/core/identifiers.md b/core/identifiers.md index 65777a6db55..2c6504808d5 100644 --- a/core/identifiers.md +++ b/core/identifiers.md @@ -164,6 +164,60 @@ services: +You can also use `#[AutoconfigureTag('api_platform.uri_variables.transformer')]` to tag the service. + +```php +getMessage()); + } + } + + /** + * Checks whether the given URI variable is supported for transformation by this transformer. + * + * @param mixed $value The URI variable value to transform + * @param array $types The types to which the data should be transformed + * @param array $context Options available to the transformer + */ + public function supportsTransformation($value, array $types, array $context = []): bool + { + foreach ($types as $type) { + if (is_a($type, Uuid::class, true)) { + return true; + } + } + + return false; + } +} +``` + Your `PersonProvider` will now work as expected! ### Tag the Service using Laravel