You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
That's it. Alternatively, if you prefer to not use PHP attributes, you must
277
+
configure a service for the entity listener and :doc:`tag it </service_container/tags>`
278
+
with the ``doctrine.orm.entity_listener`` tag as follows:
260
279
261
280
.. configuration-block::
262
281
@@ -353,30 +372,6 @@ with the ``doctrine.orm.entity_listener`` tag:
353
372
;
354
373
};
355
374
356
-
357
-
Doctrine Entity Listeners may also be defined using PHP attributes. When using PHP attributes it is not necessary to create a service for the listener.
358
-
359
-
.. code-block:: php
360
-
361
-
// src/EventListener/UserChangedNotifier.php
362
-
namespace App\EventListener;
363
-
364
-
use App\Entity\User;
365
-
use Doctrine\Persistence\Event\LifecycleEventArgs;
366
-
use Doctrine\Bundle\DoctrineBundle\Attribute\AsEntityListener;
0 commit comments