Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InvalidConfigurationException: Unrecognized options "auto_mapping" under "doctrine.orm" #141

Closed
Ziiweb opened this issue Jul 16, 2012 · 8 comments

Comments

@Ziiweb
Copy link

Ziiweb commented Jul 16, 2012

Hi,

after following the instructions to install this bundle, Im getting this error:

InvalidConfigurationException: Unrecognized options "auto_mapping" under "doctrine.orm"

I found other issues related to this problem but i did not find a solution..

This is my config.yml:


doctrine:
    orm:
        auto_generate_proxy_classes: %kernel.debug%
        auto_mapping: true
        entity_managers:
            default:
                mappings:
                    StofDoctrineExtensionsBundle: ~

and this below is my composer.phar:


{
    "name": "symfony/framework-standard-edition",
    "description": "The \"Symfony Standard Edition\" distribution",
    "autoload": {
        "psr-0": { "": "src/" }
    },  
    "require": {
        "php": ">=5.3.3",
        "symfony/symfony": "2.1._",
        "doctrine/orm": "2.2._",
        "doctrine/doctrine-bundle": "dev-master",
        "twig/extensions": "dev-master",
        "symfony/assetic-bundle": "dev-master",
        "symfony/swiftmailer-bundle": "dev-master",
        "symfony/monolog-bundle": "dev-master",
        "sensio/distribution-bundle": "dev-master",
        "sensio/framework-extra-bundle": "dev-master",
        "sensio/generator-bundle": "dev-master",
        "jms/security-extra-bundle": "1.1._",
        "jms/di-extra-bundle": "1.0._",
        "gedmo/doctrine-extensions": "dev-master",
        "friendsofsymfony/user-bundle": "_",
        "stof/doctrine-extensions-bundle": "dev-master",
        "knplabs/knp-menu-bundle" : "1.1._",
        "knplabs/knp-menu" : "1.1.*",
        "sonata-project/exporter" : "dev-master",
        "sonata-project/jquery-bundle" : "dev-master",
        "sonata-project/block-bundle" : "dev-master",
        "sonata-project/cache-bundle" : "dev-master",
        "sonata-project/admin-bundle" : "dev-master",
        "sonata-project/user-bundle" : "dev-master",
        "sonata-project/doctrine-orm-admin-bundle" : "dev-master"

Javi

@stof
Copy link
Owner

stof commented Jul 16, 2012

you are mixing the short syntax and the complete syntax for the ORM config. You should choose one of them only.

short syntax:

doctrine:
    orm:
        auto_generate_proxy_classes: %kernel.debug%
        auto_mapping: true
        mappings:
            StofDoctrineExtensionsBundle: ~

expanded syntax:

doctrine:
    orm:
        auto_generate_proxy_classes: %kernel.debug%
        entity_managers:
            default:
                auto_mapping: true
                mappings:
                    StofDoctrineExtensionsBundle: ~

And btw, your config for the mapping is wrong. There is no entity in the bundle at all (and they would be catched by the auto_mapping otherwise anyway). What needs to be mapped are the entities of the extensions. See the related documentation

@stof stof closed this as completed Jul 16, 2012
@luisansal
Copy link

Thank you, i didn't know that expanded syntax!!!, good man!

@ureimers
Copy link

Didn't know of the short <> complete syntax discrepancy either. Thank you!

@ajaypatelbardoli
Copy link

Thanks for the solution though i have not asked this questions but i have also faced this questions :)

@matheo
Copy link

matheo commented Mar 5, 2014

I have a quick related question:
While using multiple entity managers, a config like this:

entity_managers:
    default:
        connection: connection_1
        auto_mapping: true
    second_em:
        connection: connection_2
        mappings:
            FooBarBundle: ~

will allow FooBarBundle to be in the connection_2 while the others Bundles in the app will be mapped by the default entity manager with connection_1?
TIA

@fundup
Copy link

fundup commented Jul 9, 2015

Using this config and SYmfony 2.7

orm:
        auto_generate_proxy_classes: "%kernel.debug%"
        naming_strategy: doctrine.orm.naming_strategy.underscore
        auto_mapping: true
        dql:
            datetime_functions:
                month: DoctrineExtensions\Query\Mysql\Month
                year: DoctrineExtensions\Query\Mysql\Year

I have an error :
Attempted to load class "Month" from namespace "DoctrineExtensions\Query\Mysql".
Did you forget a "use" statement for another namespace?

I tried to add a use statement in my reposotory...
If anyone as an idea ?

@BigWenceslas
Copy link

Same issue... I have an error :
Attempted to load class "Month" from namespace "DoctrineExtensions\Query\Mysql".
Did you forget a "use" statement for another namespace?

@stof
Copy link
Owner

stof commented Apr 29, 2020

@BigWenceslas These classes don't belong to this bundle, nor to the Gedmo extensions. So this is the wrong place to report this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants