Mapping Doctrines in Symfony2 Using YAML

I have a question regarding the configuration of YAML Doctrine in Symfony2.

I created the object via "doctrine: generate: entity" and selected YAML as the display format. This did not add any metadata to .. / Entity / "MyEntity..php, which would allow me to update or create my schema.

As an example, if I run

./app/console doctrine:schema:create

he fails saying:

[RuntimeException]                                                 
Bundle "MySuperBundle" does not contain any mapped entities.

My car is already set to true.

If I want to use the annotation configuration, this will not be a problem.

Did I miss something? Are there any additional steps that I should take?

Thank you in advance,

Ivan

+4
1

, Doctrine. :

  • auto_mapping , ; type
  • type , , , , , xml, yml, php
  • , annotation

- Bundle/Resources/config/doctrine? , .

, , , , , - . , "auto_mapping" , Doctrine?

, , . Symfony Doctrine,

doctrine:
    dbal:
        driver:   "%database_driver%"
        #etc

    orm:
        auto_generate_proxy_classes: "%kernel.debug%"
        auto_mapping: true

doctrine:
    dbal:
        driver:   "%database_driver%"
        #etc

    orm:
        auto_generate_proxy_classes: "%kernel.debug%"
        auto_mapping: false
        mappings:
            MySuperBundleName:
                type: yml
                dir: Resources/config/doctrine
+6

All Articles