Skip to content

Commit 662fcbf

Browse files
committed
minor #17661 We need to use AsEntityListener instead of AsDoctrineListener (cedriclombardot)
This PR was submitted for the 6.2 branch but it was squashed and merged into the 6.0 branch instead. Discussion ---------- We need to use AsEntityListener instead of AsDoctrineListener Commits ------- d9b62bb We need to use AsEntityListener instead of AsDoctrineListener
2 parents 7b93c1f + d9b62bb commit 662fcbf

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

doctrine/events.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ First, define a PHP class that handles the ``postUpdate`` Doctrine event::
255255
}
256256
}
257257

258-
Then, add the ``#[AsDoctrineListener]`` attribute to the class to enable it as
258+
Then, add the ``#[AsEntityListener]`` attribute to the class to enable it as
259259
a Doctrine entity listener in your application:
260260

261261
.. code-block:: php
@@ -265,9 +265,10 @@ a Doctrine entity listener in your application:
265265
266266
// ...
267267
use App\Entity\User;
268-
use Doctrine\Bundle\DoctrineBundle\Attribute\AsDoctrineListener;
268+
use Doctrine\Bundle\DoctrineBundle\Attribute\AsEntityListener;
269+
use Doctrine\ORM\Events;
269270
270-
#[AsDoctrineListener(event: 'postUpdate', method: 'postUpdate', entity: User::class)]
271+
#[AsEntityListener(event: Events::postUpdate, method: 'postUpdate', entity: User::class)]
271272
class UserChangedNotifier
272273
{
273274
// ...

0 commit comments

Comments
 (0)