Alex Rivera | Logout

insert ignore on duplicate entries in Doctrine2/Symfony2

Asked 2012-03-14T09:58:12.273
25

How to ignore on duplicate entries using Doctrine2?

Error example:

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'symfony' for key 'UNIQ_389B783389B783'
Edit
Report

1 Answer

13

You can always catch the exception and then ignore it. Just be aware that when the entity manager raises an exception, the entity manager can no longer be used during that request.

answered 2012-03-14T13:20:08.990

Your Answer