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:
80
80
- ' The bin/console Command'
81
81
- ' # username is your full Gmail or Google Apps email address'
82
82
- ' .. _`LDAP injection`: http://projects.webappsec.org/w/page/13246947/LDAP%20Injection'
83
+ - ' .. versionadded:: 2.7.2' # Doctrine
83
84
- ' .. versionadded:: 1.9.0' # Encore
84
85
- ' .. versionadded:: 0.28.4' # Encore
85
86
- ' .. 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:
149
149
150
150
.. configuration-block ::
151
151
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
+
152
169
.. code-block :: yaml
153
170
154
171
# config/services.yaml
@@ -219,6 +236,12 @@ with the ``doctrine.event_listener`` tag:
219
236
;
220
237
};
221
238
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
+
222
245
.. tip ::
223
246
224
247
Symfony loads (and instantiates) Doctrine listeners only when the related
You can’t perform that action at this time.
0 commit comments