How do I change symfony 2 doctrine mapper to use my custom directory instead of my Entity Directory under the bundle

后端 未结 3 502
甜味超标
甜味超标 2021-01-05 02:29

I use doctrine in my symfony 2.3 application. I want to use a folder structure like

/MyBundleName/User/User.php

for my Entities.

3条回答
  •  悲&欢浪女
    2021-01-05 03:16

    you can tell Doctrine the directory where is your entities

    doctrine:
    orm:
        auto_generate_proxy_classes: %kernel.debug%
        auto_mapping: false
        mappings:
            name:
                type: php
                dir: %kernel.root_dir%/../src/Company/CartoDBBundle/Tests/CartoDB/Entity
    

    Here you have the full documentation Doctrine configuration

    I made a similar question a few days ago, there you can read the full answer Cedar gave me
    Similar post

提交回复
热议问题