Skip to content

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.
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