Skip to content

Commit

Permalink
[Documentation] Just a hint... (#77)
Browse files Browse the repository at this point in the history
Co-authored-by: Jacob Dreesen <j.dreesen@neusta.de>
  • Loading branch information
mike4git and jdreesen authored Aug 12, 2024
1 parent 4da36d2 commit 91a1da3
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 91a1da3

Please sign in to comment.