Michael Mezger
Michael Mezger

Reputation: 123

Symfony2 + doctrine2: Switch to metadata driver "yml"

a short question: How to switch to the another metadata driver than annotation. How to set the metadata driver "yml" in the config.yml?

I`ve searched google and the symfony2 docu, but didnt find anything :(

thanks

Upvotes: 2

Views: 2843

Answers (2)

Seth Griffin
Seth Griffin

Reputation: 75

I realize this is an older question but you can explicitly require that doctrine use the yml driver for meta data like this:

doctrine:
  orm:
    entity_managers:
      mappings:
        MyBundleName:
          type: yml
          dir: path/to/ymlmetadata

Be aware that if you use this configuration style then you have to put the "defaults" config node under entity_managers instead of its usual location.

Upvotes: 1

Peter Bailey
Peter Bailey

Reputation: 105918

You should be able to do that with the doctrine:mapping:convert command

php app/console doctrine:mapping:convert --force yml ./src/

Double check all the options available before you run the command, though

php app/console help doctrine:mapping:convert

Upvotes: 10

Related Questions