Convert from Database / Excel / CSV to YAML data fixtures?

calendar_today Asked Jul 29, 2010
thumb_up 8 upvotes
history Updated April 16, 2026

Question posted 2010 · +5 upvotes

Was wondering if there is an easy to convert structured files into YAML data fixtures for Doctrine / Symfony.

I don’t see any utility with Doctrine to accept CSV.

I might just start writing something simple to do this. Is it worthwhile?

Accepted answer +8 upvotes

I wrote my own Macro to solve this problem & shared it. You can specify the fields in your model, fill-out the data and the YAML is generated. The best part is that it supports Nested Data as well (based on NestedSet Doctrine Behaviour)

You can download the file from here: http://www.prasadgupte.com/go/converting-csvexcel-data-to-doctrine-yaml-fixtures/

Hope this helps!

Top excel Q&A (6)

+8 upvotes ranks this answer #106 out of 167 excel solutions on this site .