For simplicity I’m not going to use any migrations mechanism. I’ll be adding new SQL queries to the end of dump.sql. For non-demo projects I personally prefer to use the migrations extension for Doctrine 2: https://github.com/doctrine/migrations
Mapping
In order for the data to be saved into the database, domain model has to be mapped to the tables structure.
You can find the rest in the Git repository. You may want to test the mapping using the doctrine’s console tool, running doctrine orm:validate-schema. In order to do that you’ll need to create cli-config.php in the application directory. Follow the official doctrine documentation or check out my Github repository.
Comments and feedback are much appreciated. See contact details here