Day 3: The Data Model
35
We also need to remove the web/sfPropelPlugin directory: $ rm web/sfPropelPlugin
Listing 3-5
Another recommendation when using Doctrine instead of Propel is to remove the config/ propel.ini and config/schema.yml so you have a clean installation with no references to Propel. $ rm config/propel.ini $ rm config/schema.yml
Listing 3-6
The Relational Model The user stories we have written yesterday describe the main objects of our project: jobs, affiliates, and categories. Here is the corresponding entity relationship diagram:
In addition to the columns described in the stories, we have also added a created_at field to some tables. Symfony recognizes such fields and sets the value to the current system time when a record is created. That’s the same for updated_at fields: Their value is set to the system time whenever the record is updated.
The Schema To store the jobs, affiliates, and categories, we obviously need a relational database. But as symfony is an Object-Oriented framework, we like to manipulate objects whenever we can. For example, instead of writing SQL statements to retrieve records from the database, we’d rather prefer to use objects.
-----------------
Brought to you by