I would like to receive the exact SQL INSERT query that Doctrine generates when the save () method is called.
Preferably, I would like to get it in the postSave () event of the model and register it in the txt file.
For example:
<?php $user = new User(); // A Doctrine Model with timestampable behavior enabled $user->first_name = 'Manny'; $user->last_name = 'Calavera'; $user->save(); ?>
I want to receive / register the following SQL query:
INSERT INTO user (first_name, last_name, created_at, updated_at) VALUES ('Manny', 'Calavera', '2010-08-03 12:00:00', '2010-08-03 12:00:00');
A prerequisite for this is that I want to mass import data by analyzing the txt file.
sql import php doctrine
aletzo
source share