Skip to content

Updating doctrine class use #7750

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

Closed
wants to merge 2 commits into from
Closed

Conversation

David-Crty
Copy link
Contributor

Because now composer.json of symfony 3.2 use doctrine ^2.5 shouldn't we use use Doctrine\Common\Persistence\Event\LifecycleEventArgs; by default in exemple ?

Because now composer.json of symfony 3.2 use doctrine ^2.5 shouldn't we use use Doctrine\Common\Persistence\Event\LifecycleEventArgs; by default in exemple ?
It's seems that getEntity() is deprecated and getEntityManager() doesn't exist anymore, now doctrine use Object as term.
@@ -169,8 +169,8 @@ interface and have an event method for each event it subscribes to::
namespace AppBundle\EventListener;

use Doctrine\Common\EventSubscriber;
use Doctrine\ORM\Event\LifecycleEventArgs;
// for Doctrine 2.4: Doctrine\Common\Persistence\Event\LifecycleEventArgs;
// for Doctrine < 2.4: use Doctrine\ORM\Event\LifecycleEventArgs;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't replace "Doctrine 2.4" by "Doctrine < 2.4". It should be "Doctrine <= 2.4" or "Doctrine < 2.5", right?

Copy link
Contributor Author

@David-Crty David-Crty Apr 4, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The use Doctrine\ORM\Event\LifecycleEventArgs; need to be use for doctrine before 2.4.
For doctrine >= 2.4 we need to use Doctrine\Common\Persistence\Event\LifecycleEventArgs;

@xabbuh xabbuh added this to the 2.7 milestone Jul 7, 2017
@xabbuh
Copy link
Member

xabbuh commented Jul 7, 2017

Thank you @David-Crty.

xabbuh added a commit that referenced this pull request Jul 7, 2017
This PR was submitted for the 3.2 branch but it was merged into the 2.7 branch instead (closes #7750).

Discussion
----------

Updating doctrine class use

Because now composer.json of symfony 3.2 use doctrine ^2.5 shouldn't we use use Doctrine\Common\Persistence\Event\LifecycleEventArgs; by default in exemple ?

Commits
-------

958df16 Updating doctrine class use
@xabbuh xabbuh closed this Jul 7, 2017
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.

4 participants