I have complex logic which is not possible (too slow) to run through PHP with Doctrine, so I need to create a stored procedure for this. The logic also includes inserting/updating records in a table using the Timestampable behavior. How do I preserve this behavior in the stored procedure?
Share
If your schema uses the default Timestampable behaviour from Doctrine, then you have the
created_atandupdated_atdatetime columns added to your table schema. Then I’d imagine that in your stored procedure, you can update bothcreated_atandupdated_atto the current date & time (using egNOW()) if the record is new, and onlyupdated_atif the record is existing.This assumes that your stored procedure can differentiate between new and existing records.