Live geek or die tryin'

Symfony 2: Execute Console Commands on a Specific Entity Manager

The following isn’t an exact science, however, if you didn’t --help, it will spare you a 10min research.
This is your lifesaver: --em.

Example

In case you want to generate mapping information using the “client” entity manager:

php app/console doctrine:mapping:convert yml /src/Acme/ClientBundle/Resources/config/doctrine/metadata/orm --from-database --force --em="client

Translated from my french post Symfony2: Executer les commandes console sur un Entity Manager spécifique

Comments