Skip to content

[Doctrine] Fix wrong event class for entity listener in example #12532

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

Merged
merged 1 commit into from
Oct 22, 2019

Conversation

sadikoff
Copy link
Contributor

Using class PreUpdateEventArgs in code example causes an exception:

Argument 2 passed to App\EventListener\UserChangedNotifier::postUpdate() must be an instance of Doctrine\ORM\Event\PreUpdateEventArgs, instance of Doctrine\ORM\Event\LifecycleEventArgs given, called in .../vendor/doctrine/orm/lib/Doctrine/ORM/Event/ListenersInvoker.php on line 112

@sadikoff sadikoff changed the title [Doctrine] Wrong event class for entity listener in example [Doctrine] Fix wrong event class for entity listener in example Oct 22, 2019
using class `PreUpdateEventArgs` causes exception 

>Argument 2 passed to App\EventListener\UserChangedNotifier::postUpdate() must be an instance of Doctrine\ORM\Event\PreUpdateEventArgs, instance of Doctrine\ORM\Event\LifecycleEventArgs given, called in .../vendor/doctrine/orm/lib/Doctrine/ORM/Event/ListenersInvoker.php on line 112
@weaverryan weaverryan changed the base branch from master to 4.3 October 22, 2019 12:33
@weaverryan
Copy link
Member

Thanks Vladimir!

weaverryan added a commit that referenced this pull request Oct 22, 2019
…ample (sadikoff)

This PR was submitted for the master branch but it was merged into the 4.3 branch instead (closes #12532).

Discussion
----------

[Doctrine] Fix wrong event class for entity listener in example

Using class `PreUpdateEventArgs` in code example causes an exception:

>Argument 2 passed to App\EventListener\UserChangedNotifier::postUpdate() must be an instance of Doctrine\ORM\Event\PreUpdateEventArgs, instance of Doctrine\ORM\Event\LifecycleEventArgs given, called in .../vendor/doctrine/orm/lib/Doctrine/ORM/Event/ListenersInvoker.php on line 112

<!--

If your pull request fixes a BUG, use the oldest maintained branch that contains
the bug (see https://symfony.com/roadmap for the list of maintained branches).

If your pull request documents a NEW FEATURE, use the same Symfony branch where
the feature was introduced (and `master` for features of unreleased versions).

-->

Commits
-------

c5be930 Fix Doctrine Entity Listeners event class
@weaverryan weaverryan merged commit c5be930 into symfony:4.3 Oct 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants