Symfony2 Error: No mapping file found named

后端 未结 5 930
我在风中等你
我在风中等你 2020-12-16 21:19

I am using Symfony2 and when i try to generate the schema ($ php app/console doctrine:generate:schema) i got an error..


    [Doctrine\\ORM\\Mapping\\MappingExcep         


        
5条回答
  •  忘掉有多难
    2020-12-16 21:55

    You are mixing Doctrine mapping formats, you have annotations and at least one XML file in Resources/config/doctrine

    From the symfony docs:

    "A bundle can accept only one metadata definition format. For example,
    it's not possible to mix YAML metadata definitions with annotated PHP
    entity class definitions."
    

    So the solution is:

    You cannot mix different Doctrine mapping formats in a given bundle. So either use annotations for all entities or use XML for all.

提交回复
热议问题