Skip to content

Commit f1aea51

Browse files
docs(dataprovider): Use argument binding instead of decoration (#1456)
Using classic decoration for the custom Data Persister in services.yaml will replace the core persister. Probably this isn't the most common case scenario; normally you would *add* your custom Data Persister to the chain of persisters instead of replacing it. Use attribute binding instead, as already explained in SymfonyCasts' video.
1 parent 378a37f commit f1aea51

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

core/data-persisters.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,8 @@ Even with service autowiring and autoconfiguration enabled, you must still confi
142142
services:
143143
# ...
144144
App\DataPersister\UserDataPersister:
145-
decorates: 'api_platform.doctrine.orm.data_persister'
145+
bind:
146+
$decorated: '@api_platform.doctrine.orm.data_persister'
146147
# Uncomment only if autoconfiguration is disabled
147148
#arguments: ['@App\DataPersister\UserDataPersister.inner']
148149
#tags: [ 'api_platform.data_persister' ]

0 commit comments

Comments
 (0)