Skip to content

Commit

Permalink
Do not want to forget this hint anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
mike4git committed Aug 9, 2024
1 parent 4da36d2 commit 2028321
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,22 @@ 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 2028321

Please sign in to comment.