Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add AsEventListener attribute #1561

Merged
merged 1 commit into from
Oct 16, 2022

Conversation

HypeMC
Copy link
Contributor

@HypeMC HypeMC commented Oct 11, 2022

Similar to #1345 allows replacing configs such as:

App\EventListener\MyListener:
    tags:
        - { name: 'doctrine.event_listener', event: 'preFlush' }
        - { name: 'doctrine.event_listener', event: 'postFlush' }

with attributes:

use Doctrine\Bundle\DoctrineBundle\Attribute\AsEventListener;
use Doctrine\ORM\Events;

#[AsEventListener(Events::preFlush)]
#[AsEventListener(Events::postFlush)]
class MyListener
{
// ...
}

@ostrolucky ostrolucky changed the base branch from 2.7.x to 2.8.x October 16, 2022 09:43
@ostrolucky
Copy link
Member

thx!

@ostrolucky ostrolucky merged commit a0e247a into doctrine:2.8.x Oct 16, 2022
@ostrolucky ostrolucky added this to the 2.8.0 milestone Oct 16, 2022
@HypeMC HypeMC deleted the add-aseventlistener-attribute branch October 16, 2022 10:03
javiereguiluz added a commit to symfony/symfony-docs that referenced this pull request Jun 27, 2024
…as added (jdreesen)

This PR was merged into the 6.4 branch.

Discussion
----------

[Doctrine] Fix the version in which AsDoctrineListener was added

See: doctrine/DoctrineBundle#1561 & doctrine/DoctrineBundle#1592

Commits
-------

dcb42cb Fix the version in which AsDoctrineListener was added
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants