Updates for Symfony 2.5 PHP Framework Cheatsheet

The following updates were made to the Symfony Cheatsheet but warrant its own post here for cleaner reference:

To generate entities from an existing Symfony database, you must first have Doctrine introspect the database, then generate the entities. Watch out for your database relationships, they will probably need to be edited, getting your Doctrine table relationships mapped properly is critical.


$ php bin/console doctrine:mapping:import --force AcmeBlogBundle yml
$ php bin/console doctrine:generate:entities AcmeBlogBundle

Note above: I despise annotations in my code, I ALWAYS use YML files. Also, depending on the Symfony file structure, you may need to use ‘app/console’ instead.

Get more details regarding your current Doctrine mappings:

$ app/console doctrine:mappings:info

About Author:

Senior Cloud Software Engineer and 25+ years experienced video production, video editing and 3D animation services for a variety of global clients including local video production here in Jacksonville, Florida.