File tree Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -186,12 +186,17 @@ interface and have an event method for each event it subscribes to::
186186
187187For a full reference, see chapter `The Event System `_ in the Doctrine documentation.
188188
189- Performance considerations
190- --------------------------------
189+ Performance Considerations
190+ --------------------------
191191
192- One subtle difference between listeners and subscribers is that Symfony will load
193- entity listeners lazily by default as of Symfony 4.2. This means that your listener class will only be fetched
194- from the service container (and thus be instantiated) once the event it is linked
195- to actually fires .
192+ One important difference between listeners and subscribers is that Symfony loads
193+ entity listeners lazily. This means that the listener classes are only fetched
194+ from the service container (and instantiated) if the related event is actually
195+ fired .
196196
197- So whenever possible it is preferable to use entity listeners instead of subscribers.
197+ That's why it is preferable to use entity listeners instead of subscribers
198+ whenever possible.
199+
200+ .. versionadded :: 4.2
201+ The default lazy behavior of Doctrine entity listeners was introduced in
202+ Symfony 4.2.
You can’t perform that action at this time.
0 commit comments