Generate Symfony2 fixtures from DB?
There’s no direct manner within Doctrine or Symfony2, but writing a code generator for it (either within or outside of sf2) would be trivial. Just pull each property and generate a line of code to set each property, then put it in your fixture loading method. Example: <?php $i = 0; $entities = $em->getRepository(‘MyApp:Entity’)->findAll(); foreach($entities … Read more