From 91a1da372a66397e3ac3ee29befce0f3611962ed Mon Sep 17 00:00:00 2001 From: Michael Albrecht Date: Mon, 12 Aug 2024 10:30:57 +0200 Subject: [PATCH] [Documentation] Just a hint... (#77) Co-authored-by: Jacob Dreesen --- docs/usage.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/usage.md b/docs/usage.md index d92ab99..04a1d26 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -376,6 +376,20 @@ person.addresses.populator: There is no new converter but a different populator implementation for this. +### PropertyMappingPopulator & ArrayPropertyMappingPopulator + +#### Closure based upon your converter + +If you need a Closure which is based upon this Converter (e.g. for PropertyMappingPopulation) you can declare it in this +way and use it in the `PropertyMappingPopulator` configuration as argument for `$mapper`: + +```yaml +converter.closure.factory: + class: \Closure + factory: [ '\Closure', 'fromCallable' ] + arguments: [ '@my.converter', 'convert' ] +``` + ## Context Sometimes you will need parameterized conversion which is not depending on the objects themselves.