In the process of application development, developers often face the problem of database population.

If a few specific solutions exist for some database system, none can be used on top of the object relational mapping.

Thanks to YAML and the sfPropelData object, symfony facilitates the batch processes that take data from a text source to a database, with a syntax as simple as:

User:
  bob_walter:
    name:         Bob Walter
    login:        bwalter
    password:     sarah34
    email:        bob.walter@foomail.com

  peter_clive:
    name:         Peter Clive
    login:        pclive
    password:     gurzikso
    email:        peter.clive@foomail.com

Post:
  test_post:
    user_id:      bob_walter
    title:        Today is the first day of the rest of my life
    body:         I have plenty to say, but I prefer to stay short.

Comment:
  enthusiast_comment:
    user_id:      peter_clive
    post_id:      test_post
    body:         Hey Bob, you rock!

If you want to know more, check out the new chapter recently added to the symfony book.

Published in