@@ -272,7 +272,8 @@ with the ``doctrine.orm.entity_listener`` tag:
272
272
entity_manager : ' custom'
273
273
274
274
# by default, Symfony looks for a method called after the event (e.g. postUpdate())
275
- # but you can configure a custom method name with the 'method' option
275
+ # if it doesn't exist, it tries to execute the '__invoke()' method, but you can
276
+ # configure a custom method name with the 'method' option
276
277
method : ' checkUserChanges'
277
278
278
279
.. code-block :: xml
@@ -291,7 +292,8 @@ with the ``doctrine.orm.entity_listener`` tag:
291
292
* 'entity_manager': define it if the listener is not associated to the
292
293
* default entity manager
293
294
* 'method': by default, Symfony looks for a method called after the event (e.g. postUpdate())
294
- * but you can configure a custom method name with the 'method' option
295
+ * if it doesn't exist, it tries to execute the '__invoke()' method, but
296
+ * you can configure a custom method name with the 'method' option
295
297
-->
296
298
<tag name =" doctrine.orm.entity_listener"
297
299
event =" postUpdate"
@@ -321,8 +323,9 @@ with the ``doctrine.orm.entity_listener`` tag:
321
323
// you can also associate an entity listener to a specific entity manager
322
324
'entity_manager' => 'custom',
323
325
324
- // by default, Symfony looks for a method called after the event (e.g. postUpdate()),
325
- // but you can configure a custom method name with the 'method' option
326
+ // by default, Symfony looks for a method called after the event (e.g. postUpdate())
327
+ // if it doesn't exist, it tries to execute the '__invoke()' method, but you can
328
+ // configure a custom method name with the 'method' option
326
329
'method' => 'checkUserChanges',
327
330
])
328
331
;
0 commit comments