Show
added a comment -
did a fair bit of web searching for this and could not find anything specific to this. Also asked in the doctrine irc channel (no response as yet)
based on my reading and understanding. If we want to expose the full power of doctrine and consider the custom tables as first class tables, then we need to generate the entity file(s) and expose them to doctrine.We can then use those entity files to update/maintain the schema. Handling: insert/delete of a new column is relatively easy (just add or remove the corresponding field). We currently dont allow changing the data type
We'll need to consider how/where to write these generated entities. Maybe in the symfony cache directory and regenerate them as needed. We'll need to add this path to the doctrine autoloader path. Doing so, will automatically give us the rest api and potentially also allow us simple crud operations based on sonata admin etc. So might be worth tackling for the first part of the project.
For the short/medium term, we can bypass doctrine and do this directly via PDO. However when we do a complete switchover and always go through doctrine, we'll need to make these custom tables first class entities so they can be used in DQL and other doctrine/symfony stuff.