1

I learned from the doctrine doc site how to let DQL understand a MySQL function: http://docs.doctrine-project.org/en/2.0.x/cookbook/dql-user-defined-functions.html

I want to define my own functions, procedures, views, cursors, etc. in the database, and then implement whatever's needed in Doctrine to call them.

I understand the implementation part (mostly, I guess..) But what I need is a way to add my functions and procedures in a semi-automated way, such as when I update the schema through the command line.

I found that Doctrine has events you can listen for, but there's only one, and it's called PostConnect. Doubtful if this will help me. :-)

Where do I hook in to Doctrine to execute some arbitrary SQL when the database schema is generated?

I'm using Doctrine2 and Symfony2.

Thanks.

4

0 回答 0