Is it possible to get the SQL for a Doctrine 2 entity insert?
For example, let’s say I have this:
$foo = new Foo();
$foo->setName('bar');
$em->persist($foo);
$em->flush();
Is there a way to get the SQL for the INSERT statement there? If so, how?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You could activate the query log in your MySQL server (guessing it’s it) :
in /etc/mysql/my.ini (usual place) :
then read this file where you will find each issued query.