Today I was working on a bundle for generating invoices. Since we have some kind of invoice functionality in many projects in the past, my goal was to create a nice reusable bundle.
So I started with creating an empty bundle and moved it to /vendor/bundles/Netvlies/Bundle/InvoiceBundle.
With the app/console I started generating a entity for persisting particular data for an invoice:
1 |
$ app/console doctrine:generate:entity |
This is still all pretty straight forward… so to complete this difficult task I tried to create to update the schema:
1 2 |
$ app/console doctrine:schema:update --force Nothing to update - your database is already in sync with the current entity metadata. |
Hmmz, wtf? 🙁 For some obvious reason it was ignoring my new bundle outside the src
structure? After some little investigation I discovered you have to add it to your ORM mapping like this:
1 2 3 4 5 6 7 8 9 10 11 |
doctrine: orm: auto_generate_proxy_classes: %kernel.debug% default_entity_manager: default entity_managers: default: connection: default mappings: NetvliesSomeAppBundle: ~ # add it like this NetvliesInvoiceBundle: ~ |