Use FOSUserBundle for yml based objects

I started the Symfony2 project from scratch where I installed FOSUserBundle .

Then I wrote (in fact, generated with ORM Designer) some objects that should have a relationship between them and the User object.

I Items, belonging Users, Collectionsbelonging Users, group Items, etc.

Since I used FOSUserBundle, I only have the base class User ( https://github.com/FriendsOfSymfony/FOSUserBundle/blob/master/Resources/doc/index.md , step 3a) defined using annotations, no config/doctrinefolder and no User.ymlin him.

Then I created a folder MyBundle/Resources/config/doctrineand added the files ymlmentioned above.

When I try to generate objects using the command line tool, everything works fine: it will create objects from my yml files.

However, at this point, trying to load in the browsers the URL in which the login previously worked (when I only had FOSUserBundle installed ), you will get this error:

MappingException: mapping file not found '/var/www/concert/src/X/MyBundle/Resources/config/doctrine/User.orm.yml' for class 'X \ MyBundle \ Entity \ User'.

The following steps, such as generating CRUD logic, will not work as long as I have the *.orm.yml file in the folder config/doctrine. If I delete them, CRUD generation will work, but the actual mysql table generation will not.

, , , URL-, CRUD, , yml ( , "" ), .

? yml FOSUserBundle ?

+5
1

, , ( ). , yaml , .

, FOSUserBundle-docs , , yaml, X\MyBundle\Entity\ FOSUSerBundle UserEntity:

X\MyBundle\Entity\User:
    type:  entity
    table: fos_user
    id:
        id:
            type: integer
            strategy: { generator: "AUTO" }

FOSUserBundle, BaseModel User.orm.xml, , .

, app/config/config.yml, .

+6

All Articles