doctrine / DoctrineMongoDBBundle

Integrates Doctrine MongoDB ODM with Symfony
http://symfony.com/doc/current/bundles/DoctrineMongoDBBundle/index.html
MIT License
377 stars 231 forks source link

Deprecated EventSubscriberInterface, use AsDoctrineListener #816

Closed markitosgv closed 6 months ago

markitosgv commented 6 months ago

Since symfony/doctrine-bridge 6.3: Registering "xxxxSubscriber" as a Doctrine subscriber is deprecated. Register it as a listener instead, using e.g. the #[AsDoctrineListener] attribute.

Is there any update for this?

GromNaN commented 6 months ago

Thanks for pointing this feature. It was introduced by https://github.com/doctrine/DoctrineBundle/pull/1561, renamed in https://github.com/doctrine/DoctrineBundle/pull/1592 and the EventSubscriberInterface was deprecated in https://github.com/doctrine/DoctrineBundle/pull/1664.

I'll work on it.

GromNaN commented 6 months ago

@markitosgv You can use #[AsDocumentListener] from the DoctrineMongoDBBundle.

I opened a PR to deprecate the EventSubscriberInterface, so we can remove it in 5.0.

GromNaN commented 6 months ago

The deprecation message comes from symfony/doctrine-bridge. The name of the referenced attribute should be removed or depend on if ORM or ODM are used.

GromNaN commented 6 months ago

I opened a PR on symfony bridge to update the deprecation message https://github.com/symfony/symfony/pull/53184 and update the doc to show usage of the new attribute #817