File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -80,6 +80,7 @@ whitelist:
8080 - ' The bin/console Command'
8181 - ' # username is your full Gmail or Google Apps email address'
8282 - ' .. _`LDAP injection`: http://projects.webappsec.org/w/page/13246947/LDAP%20Injection'
83+ - ' .. versionadded:: 2.7.2' # Doctrine
8384 - ' .. versionadded:: 1.9.0' # Encore
8485 - ' .. versionadded:: 0.28.4' # Encore
8586 - ' .. versionadded:: 2.4.0' # SwiftMailer
Original file line number Diff line number Diff line change @@ -149,6 +149,23 @@ with the ``doctrine.event_listener`` tag:
149149
150150.. configuration-block ::
151151
152+ .. code-block :: attribute
153+
154+ // src/App/EventListener/SearchIndexer.php
155+ namespace App\EventListener;
156+
157+ use Doctrine\Bundle\DoctrineBundle\Attribute\AsEventListener;
158+ use Doctrine\ORM\Event\LifecycleEventArgs;
159+
160+ #[AsEventListener('postPersist'/*, 500, 'default'*/)]
161+ class SearchIndexer
162+ {
163+ public function postPersist(LifecycleEventArgs $event): void
164+ {
165+ // ...
166+ }
167+ }
168+
152169 .. code-block :: yaml
153170
154171 # config/services.yaml
@@ -219,6 +236,12 @@ with the ``doctrine.event_listener`` tag:
219236 ;
220237 };
221238
239+
240+ .. versionadded :: 2.7.2
241+
242+ The :class: `Doctrine\\ Bundle\\ DoctrineBundle\\ Attribute\\ AsEventListener `
243+ attribute was introduced in DoctrineBundle 2.7.2.
244+
222245.. tip ::
223246
224247 Symfony loads (and instantiates) Doctrine listeners only when the related
You can’t perform that action at this time.
0 commit comments